Book Image

Troubleshooting Docker

By : Vaibhav Kohli, Rajdeep Dua, John Wooten
Book Image

Troubleshooting Docker

By: Vaibhav Kohli, Rajdeep Dua, John Wooten

Overview of this book

You?re pro Docker? You?ve read all about orchestration with Docker in books? Now learn how to troubleshoot Docker in practice. Gain all the tools to safely see Docker in action with this 2017 book.
Table of Contents (17 chapters)
Troubleshooting Docker
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Free Chapter
1
Understanding Container Scenarios and an Overview of Docker

Data-only container


Data can be stored outside the Docker UFS in a data-only container. The data will be visible inside the data-only container mount namespace. As the data is persisted outside the container, it remains even after the container is deleted. If any other container wants to connect to this data-only container, simply use the --volumes-from option to grab the container and apply it to the current container. Let's try out data volume container:

Using a data-only container

Creating a data-only container

$ docker create -v /tmp --name ubuntuvolume Ubuntu:14.04

In the preceding command, we created an Ubuntu container and attached /tmp. It is a data-only container based on the Ubuntu image, and exists in the /tmp directory. If the new Ubuntu container needs to write some data to the /tmp directory of our data-only container, this can be achieved with help of --volumes-from option. Now, anything we write to the /tmp directory of the new container will be saved in the /tmp volume of...