Book Image

Learning Docker - Second Edition

By : Vinod Singh, Pethuru Raj, Jeeva S. Chelladhurai
Book Image

Learning Docker - Second Edition

By: Vinod Singh, Pethuru Raj, Jeeva S. Chelladhurai

Overview of this book

Docker is an open source containerization engine that offers a simple and faster way for developing and running software. Docker containers wrap software in a complete filesystem that contains everything it needs to run, enabling any application to be run anywhere – this flexibily and portabily means that you can run apps in the cloud, on virtual machines, or on dedicated servers. This book will give you a tour of the new features of Docker and help you get started with Docker by building and deploying a simple application. It will walk you through the commands required to manage Docker images and containers. You’ll be shown how to download new images, run containers, list the containers running on the Docker host, and kill them. You’ll learn how to leverage Docker’s volumes feature to share data between the Docker host and its containers – this data management feature is also useful for persistent data. This book also covers how to orchestrate containers using Docker compose, debug containers, and secure containers using the AppArmor and SELinux security modules.
Table of Contents (13 chapters)

The volume management command

Docker has introduced a top-level volume management command from version 1.9 in order to manage the persistent filesystem effectively. The volume management command is capable of managing data volumes that are part of the Docker host. In addition to that, it also helps us to extend the Docker persistent capability using pluggable volume drivers (Flocker, GlusterFS, and so on). You can find the list of supported plugins at https://docs.docker.com/engine/extend/legacy_plugins/.

The docker volume command supports four subcommands as listed here:

  • create: This creates a new volume
  • inspect: This displays detailed information about one or more volumes
  • ls: This lists the volumes in the Docker host
  • rm: This removes a volume

Let's quickly explore the volume management command through a few examples. You can create a volume using the docker volume create subcommand, as shown here:

$ sudo...