We shall now try creating a data volume which can be used by more than one container images. This will let us make use of a common data disk for more than two container images. This is same as creating a Virtual Machine by making use of the same storage account and creating two different Virtual Machines in Azure. This will let you access data outside the container and it will be the same as mounting a folder somewhere outside the container and taking data from it.

Creation of text files

Hosting the data in the Docker Image

Creating a new file inside the mydata folder

Stopping and removing all the running containers

Note

Here, replace "fa" with first two letters of your container image.

Windows PowerShell

Checking the data in local folder

Creating data volume

Running container again with existing data volume

Deleting all the running containers at once

This is how we create container data volumes and work with them both parallelly on our container machine and on the host machine for that container.