Hello, I am trying to figure out how to get my containers to use the volumes created in docker desktop. I’ve created a seerr container, which I get an error saying it didnt set up a file correctly so each time it restarts I have to set it up all over. The docs mentioned going to the volumes tab in docker desktop and creating a volume there. I have done so, but no matter what I have tried those volumes I created are never used. If some one would be so kind and point out how to resolve this it would save me some hair. I’ve been working on this for 4-6 hours a day for the past week and im at my wits end.
Are you trying to do everything from within the UI?
You can not map a volume to a container you start from the ui. You can only map host folders into container folders, which are also called volumes, but are in fact binds, that bind a host folder into a container folder.
Though, you can map the volume into the container if you start the container either from the cli using docker run or if you create a compose file and declare your container and volume there.
That would be the case, I am trying to do everything within the Docker desktop UI. I have been reading over the material on how to do these things but I always end up with errors. I figured out that following the guide from seerr directed me to correct a volume and run the container using that volume. With that being said, I have no idea how to do it for other things. I am also attempting a TS3 instance via docker but same issue. When I attempt to run via power shell it tells me im not formatting it correctly?
What’s next:
Debug this container error with Gordon → docker ai “help me fix this container error”
docker: ‘docker run’ requires at least 1 argument
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG…] is the message I continue to get.
I am copying the bash information from the TS3 guide (I know I have to replace the \ with ` to work in powershell.
Using this is where im getting the error. Am I formatting something wrong here?
docker run -d `
--name ts3-server `
-e TS3SERVER_LICENSE=accept `
-v ts3-data:ts3server/ `
-p 9987:9987/udp `
-p 10011:10011 `
-p 30033:30033 `
teamspeak
It seems ultimately I need to learn proper format. Its been probably 20 years since ive really done anything outside of a -ping/ tracert in a cmd/power shell window.
Smh, seems I’ve been going about this all wrong. After re-reading what you said a few times here and finding Gordon I’ve realized my best bet is to bind to a host folder. Doing so would let me continue to point containers to those persistent files. (At least that’s what it appears to be). Would that be correct?
Is there any downside to doing it as a bind compared to a volume in dockers vhd?
The syntax for line continuation is different for Powershell 5.1 and Powershell Core 7.x. One uses a single backtick (like in your example) and the other uses a backslash \ (like on Linux/Mac). It is crucial that no space character is typed after the line continuation character.
I highly recommend to learn docker compose, as it will make configuring things easier. You can use websites like https://www.composerize.com to convert a docker run command into a compose file. Store the shown content in a file called compose.yml (or docker-compose.yml) and use docker compose up to deploy the container. Once it starts stop it with ctrl+c and then use docker compose up -d to deploy the container in detached mode.
The advantage of a bind is that you can access the content from the host directly. Usefull if you need to edit files in this folder. You can’t access files stored in a volume directly (unless you are using docker-ce, but it’s still not recommended). With Docker Desktop volumes are usually faster, as they reside within the utility vm that runs the docker backend. If a host folder with many files, or big files is bound into a container, it could become noticablly slow with Docker Desktop.