Skip to content
Advertisement

Docker mount volume specify path

please I really need help creating a docker volume.

By default, when I create a volume, its location will be /var/lib/docker/volumes/

I need to change this default location to my SSD disk, specifically /media/username/T7/docker/volumes

Please how do I make sure the docker I run will be stored in my SSD rather than the default location?

I will be using this docker run command

JavaScript

Thank you so much. I am really loosing it here trying to work with Linux.

Advertisement

Answer

Provide the full path.

JavaScript

This assumes the directory already exists on your host. Make sure to make and mount it.

Documentation on Docker Volumes: https://docs.docker.com/storage/volumes/

Possible Duplicate: Creating a Docker volume at a specific location

Same answer from Docker forum: https://forums.docker.com/t/how-to-make-volume-on-a-specific-path/92694/8

Similar question on Unix stack exchange: https://unix.stackexchange.com/questions/439106/docker-create-a-persistent-volume-in-a-specific-directory

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement