I’m trying to learn from scratch so I’m building my own images to gain some experience but i am confused about how to declare volumes.
I create volumes for “data containers” so that I can share the volume with another container who will use the share to add persistent data (/var/www, /var/lib/mysql, …)
Thanks for your answer! I will have to play with it I guess.
My confusion comes from when we use volumes-from. Having it already specified at the image level gives the impression it might squash the volumes-from parameter with the volume mentioned in the Dockerfile of the image.
I guess I need to play around with it. I’m enjoying it though!
volumes-from is used against the data-container and is only available while running the contianer, however VOLUME in Dockerfile only allows to mount the data folder.
Even if you specify mount folder via Dockerfile, you can still use volumes-from with the docker CLI during the runtime ( docker run ).