February 2018
Intermediate to advanced
200 pages
5h 51m
English
In step 1, we created a volume for a Docker container using an Ansible module called docker_volume. The same module can be used to delete an existing volume by setting the parameter state as absent.
In step 2, we mounted the volume created in step 1 to a Docker container, using the Ansible module docker_container with the additional parameter volume. We specified the volume name created in step 1 and a mount path inside the container.
This can be verified by using the command docker inspect myfirstinstance. This will display the mounts of a container and details about them.
Read now
Unlock full access