Book Image

Docker Bootcamp

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

Docker Bootcamp

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

Overview of this book

<p>Docker allows you to create a robust and resilient environment to generate portable, composable, scalable, and stable application containers.</p> <p>The book starts by installing the core Docker Engine on MacOS, Windows 10 and Linux desktops. We will then define multi-container applications and understand the advantages of using containers locally. Once this is done, we will deploy containers on a single Docker host which is publicly accessible. Furthermore, we will learn how to deploy and configure a Docker Swarm cluster and explore networking and storage third-party plugins to extend the core Docker functionality. Towards the end, the book will demonstrate how to monitor and troubleshoot day-to-day problems in addition to various real world examples of container deployments.</p>
Table of Contents (15 chapters)

Testing your installation


Now that we have Docker installed, we are going to quickly test our installation by downloading, running and connecting to a NGINX container.

Note

NGINX is a free, open source, high-performance HTTP server and reverse proxy. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.

Tip

A note on Docker commands

Docker 1.13 introduced a slightly altered set of command line instructions for interacting with containers and images. As this syntax will eventually become the new standard we will be using it throughout this book. For more information on the CLI restructure, please see the Docker 1.13 announcement blog post at https://blog.docker.com/2017/01/whats-new-in-docker-1-13/

To download and launch the container all you need to do run the following commands from your terminal prompt;

docker image pull nginx
docker container run -d --name nginx-test -p 8080:80 nginx

The first command pulls the NGINX container image from the Docker Hub, and the second command launches our NGINX container, naming it nginx-test mapping port 8080 on your machine to port 80 on the container.

You can check that the container is running using the following command:

docker container ps

Opening your browser and going to http://localhost:8080/ should show you the default Welcome to NGINX page.

As you can see from the following screens, the process is the same when using Docker for Mac:

Docker for Windows:

Or Docker on Ubuntu 16.04:

As you can see from the screens above, the result of us running the same command on each of the three platforms is exactly the same.

Once you have tested launching a container you can tidy up afterwards by running the following commands to stop and remove the container and then delete the image:

docker container stop nginx-test
docker container rm nginx-test
docker image rm nginx