By max johnson
I simply copy pasted from a github project since I am docker naive. I don’t understand the difference between
docker run -d --name=try_firefox --restart always -p 5822:5800 -v try_firefox:/config:rw jlesage/firefox
docker run -d --name=try_firefox --restart always -p 5822:5800 -v /docker/appdata/try_firefox:/config:rw jlesage/firefox
only in the first case is anything found by docker volumes
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi,
In the first command (-v try_firefox:/config
), you’re creating a named volume called try_firefox
, which is why it shows up when you run docker volume ls
:
In the second command (-v /docker/appdata/try_firefox:/config
), you’re using a bind mount to map a host directory into the container. Bind mounts don’t appear in docker volume ls
because they’re just regular filesystem paths on your host, not managed Docker volumes.
For more on that, I would suggest the official docs where they cover the differences more in depth:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.