Hi there,
I am trying to follow the course for Docker Deep Dive: Advance Technique especially for the Mount Volume section (Demonstrating Volumes with Containers and Services)
It looks like the command below did not create a volume automatically.
$ docker container run -dit --name voltainer --mount type=bind,source=/usercode/bizvol,target=/vol alpine
It said in the content by running that command:
- If you specify an existing volume, Docker will use the existing volume.
- If you specify a volume that doesn’t exist, Docker will create it for you.
However, since the volume does not exist, Docker did not create the volume after running the command.
Does the correct command should be like this?
docker container run -dit --name voltainer --volume ./bizol:/vol alpine
it looks like if we are using mount
it did not create the volume after running the command, however it will create one if we use volume
instead.
Thanks
Course: Docker Deep Dive: Advanced Techniques - Learn Interactively
Lesson: Demonstrating Volumes with Containers and Services