Why Aren’t My Docker Volumes Being Created for Rustdesk?

0
12
Asked By DockerDude48 On

I'm using Docker version 26.1.3 and running portainer-ce:latest on Rocky 8.10. I'm trying to set up Rustdesk using their provided compose file (you can check it out [here](https://docs.lunyaa.dev/docker-compose/rustdesk)), but I'm running into an issue. Here's the section of the docker-compose file I've got:

services:
hbbs:
image: rustdesk/rustdesk-server:latest
container_name: rustdesk-hbbs
command: hbbs
volumes:
- ./rustdesk/data:/root
ports:
- "21115:21115"
- "21116:21116/tcp"
- "21116:21116/udp"
- "21118:21118"
depends_on:
- hbbr
restart: unless-stopped

hbbr:
image: rustdesk/rustdesk-server:latest
container_name: rustdesk-hbbr
command: hbbr
volumes:
- ./rustdesk/data:/root
ports:
- "21117:21117"
- "21119:21119"
restart: unless-stopped

While the stack deploys fine and the containers are running, I'm not seeing any volumes being created. Any guidance would be greatly appreciated!

3 Answers

Answered By DevGuru85 On

To clarify for everyone, in your current setup, you're not actually creating a Docker volume, you're creating a bind mount. That means the data will be stored in the specified local directory. If you want a Docker-managed volume that persists between container restarts, adjust your volume definitions as I mentioned earlier. And any errors should pop up if Docker can’t access the directories when deploying.

Answered By TechWiz123 On

It looks like your configuration is set up for bind mounts instead of creating volumes. For Docker to create a volume, you should define it without the './' notation. Instead of your current entries under volumes, try changing them to something like this:

- rustdesk:/root

Additionally, make sure to include a 'volumes' section at the end of your compose file to declare the volume. It should look like this:

volumes:
rustdesk:

Answered By CodeCrafter99 On

Just double-check, do you have a 'rustdesk' directory in the same location as your compose file? It should contain a 'data' subdirectory because with your setup, that's where the bind mount would point to. If that directory doesn't exist, it won't be created automatically, and Docker will throw an error when it can't access it.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.