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

Monitoring containers


There are a few ways of monitoring the running Docker containers. They includes viewing the log files, looking at the container events and statistics, and also inspecting container properties. Let's begin with the logging. Docker has powerful logging features. An access to the log entries is crucial, especially if you have your container running in the detached runtime mode. Let's see what Docker can offer when it comes to a logging mechanism.

Viewing logs

Most applications output their log entries to the standard stdout stream (normally you just see in in the console when you run the application). However, when running from Docker in detached mode, we see nothing on the console because the container runs in the background. To view the log entries from the container, execute the following command:

docker logs -f <container name>

The -f flag acts as the same flag in Linux tail command; it will continuously display new log entries on the console. When you are done...