Book Image

Docker Cookbook

By : Neependra Khare
Book Image

Docker Cookbook

By: Neependra Khare

Overview of this book

<p>Docker is a Linux container engine that allows you to create consistent, stable, and production-quality environments with containers.</p> <p>You will start by installing Docker and understanding and working with containers and images. You then proceed to learn about network and data management for containers. The book explores the RESTful APIs provided by Docker to perform different actions such as image/container operations. Finally, the book explores logs and troubleshooting Docker to solve issues and bottlenecks. This book will also help you understand Docker use cases, orchestration, security, ecosystems, and hosting platforms to make your applications easy to deploy, build, and collaborate on.</p>
Table of Contents (17 chapters)
Docker Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing Docker


As there are many distributions which support Docker, we'll just look at the installation steps on Fedora 21 in this recipe. For others, you can refer to the installation instructions mentioned in the See also section of this recipe. Using Docker Machine, we can set up Docker hosts on local systems, on cloud providers, and other environments very easily. We'll cover that in a different recipe.

Getting ready

Check for the prerequisites mentioned in the previous recipe.

How to do it…

  1. Install Docker using yum:

    $  yum -y install docker
    

How it works...

The preceding command will install Docker and all the packages required by it.

There's more…

The default Docker daemon configuration file is located at /etc/sysconfig/docker, which is used while starting the daemon. Here are some basic operations:

  • To start the service:

    $ systemctl start docker
    
  • To verify the installation:

    $ docker info
    
  • To update the package:

    $ yum -y update docker
    
  • To enable the service start at boot time:

    $ systemctl enable docker
    
  • To stop the service:

    $ systemctl stop docker
    

See also