Docker volumes are very useful when we need to persist data in Docker containers or share data between containers.
Docker volumes are important ...
For further actions, you may consider blocking this person and/or reporting abuse
I don't understand that part:
It means that with the following image:
Built and executed as follows
I would have a file
bar
in/tmp/my-temp-dir
?I don't know for Docker volumes but I doubt the container's
/data/bar
file which was created during thedocker build
(making/data/bar
part of the Docker image basically) would be back-copied into host's/tmp/my-temp-dir
directory...Usually when you mount host's
/tmp/my-temp-dir
as container's/data/bar
, any content of container/image's/data/bar
is replaced. That's why so many images have a setup/fill part in their entrypoint's script.You are correct, and I have edited the article to reflect this. Thank you.