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,  ...

Get Developing with Docker now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.