Summary
We covered the following topics in this chapter:
- Docker volumes can be used to share folders or files from the host with the container(s).
- Containers can share volumes using named volumes or
-volumes-from
flag. - Applications using shared volumes should make ensure that multiple containers do not write to a shared file at once or else the data might end up corrupted.
- Relational databases can also be run and configured as containers.
- Volumes attached to a container in running state cannot be deleted. The container should be stopped first to delete the volume.
- Multiple volumes can be attached to one container.
VOLUME
is a Dockerfile instruction which can be used to create volumes as part of the build process.- Microsoft provides a container image for SQL Server Express 2016 and 2014 which can be readily used.
- We can use Azure storage for Azure container hosts or storage spaces for on-premises container hosts while using database containers to configure scalable storages.