![Mac os docker image location](https://loka.nahovitsyn.com/6.jpg)
![mac os docker image location mac os docker image location](https://s3.amazonaws.com/share.viget.com/how-to-use-docker-on-os-x/docking-on-os-x.png)
Well, in order to do so we need to use a docker volume plugin. Original post using the docker volume plugin – 2018 What will happen when this named volume is used in a container is that /sqlserver will be mounted to /var/lib/docker/volumes/sqlserver/_dataĪnd there you have it, a named volume in a custom location
![mac os docker image location mac os docker image location](https://i0.wp.com/www.docker.com/blog/wp-content/uploads/2021/04/docker-desktop-m1.jpg)
There we can see the device listed, /sqlserver, and the mount point, /var/lib/docker/volumes/sqlserver/_data. So let’s create a directory to point our named volume to: –Īnd now create the named volume using the local driver and the bind option, setting the device to our custom location: –ĭocker volume create -driver local -o o=bind -o type=none -o device=/sqlserver sqlserver
Mac os docker image location how to#
I’ve left the details of how to use the plugin below as it does work to move a named volume but the plugin has not been updated for a while so using the local driver is the preferred way. However, you can do this without using a plugin by using the docker local driver and the bind option, which I’ll go through here. This article originally only talked about using a docker volume plugin called Local Persist to change the location of a named volume. But what if we want to change that location?
![mac os docker image location mac os docker image location](https://i.stack.imgur.com/KXLXJ.png)
You can see above where the named volume lives on the host. – I’ve previously written about persisting data using named volumes hereįirst let’s have a look at a named volume. They give me something to go away and investigate (many thanks to Dave Walden ( b| t) for his help!) This is one of the things that I love about presenting, being asked questions that I don’t know the answer to. The question was, “can you change the location of named volumes in docker?” A few weeks ago I was presenting at SQL Saturday Raleigh and was asked a question that I didn’t know the answer to.
![Mac os docker image location](https://loka.nahovitsyn.com/6.jpg)