Book Image

Developing with Docker

By : Jaroslaw Krochmalski, Jarosław Krochmalski
Book Image

Developing with Docker

By: Jaroslaw Krochmalski, Jarosław Krochmalski

Overview of this book

This fast-paced practical guide will get you up and running with Docker. Using Docker, you will be able to build, ship, and run many distributed applications in real time. You will start with quickly installing Docker and start working with images and containers. We will present different types of containers and their applications, and show you how to find and build images. You will learn how you can contribute to the image repository by publishing different images. This will familiarize you with the image building process and you will be able to successfully run your programs within containers. By finishing this book, you will be well equipped in deploying your applications using Docker and will have a clear understanding of concepts, techniques, and practical methods to get it running in production systems.
Table of Contents (16 chapters)
Developing with Docker
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Containers


A running instance of an image is called a container. Docker launches them using the Docker images as read-only templates. To use a programming metaphor, if an image is a class, then a container is an instance of a class-a runtime object. Containers are lightweight and portable encapsulations of an environment in which to run applications. To turn an image into a container, the Docker engine takes the image, adds a read/write filesystem on top, and initializes various settings, including network ports, container name, ID, and resource limits (we will be talking about applying resource limits to a container in Chapter 7Running Containers). To run a container, use the same command we used in the previous chapter when we tested our installation, docker run:

   $ 
docker run [OPTIONS] IMAGE [COMMAND]
   [ARG...]

Tip

You can have many running containers of the same image.

There are a lot of run command options that can be used. Some of them include the network configuration, for...