Docker Cookbook

80 hands-on recipes to efficiently work with the Docker 1.6 environment on Linux

Docker Cookbook

This ebook is included in a Mapt subscription
Neependra Khare

1 customer reviews
80 hands-on recipes to efficiently work with the Docker 1.6 environment on Linux
$0.00
$30.60
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Code Files
Preview in Mapt

Book Details

ISBN 139781783984862
Paperback248 pages

Book Description

Docker is a Linux container engine that allows you to create consistent, stable, and production-quality environments with containers.

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.

Table of Contents

Chapter 1: Introduction and Installation
Introduction
Verifying the requirements for Docker installation
Installing Docker
Pulling an image and running a container
Adding a nonroot user to administer Docker
Setting up the Docker host with Docker Machine
Finding help with the Docker command line
Chapter 2: Working with Docker Containers
Introduction
Listing/searching for an image
Pulling an image
Listing images
Starting a container
Listing containers
Looking at the logs of containers
Stopping a container
Deleting a container
Setting the restart policy on a container
Getting privileged access inside a container
Exposing a port while starting a container
Accessing the host device inside the container
Injecting a new process to a running container
Returning low-level information about a container
Labeling and filtering containers
Chapter 3: Working with Docker Images
Introduction
Creating an account with Docker Hub
Creating an image from the container
Publishing an image to the registry
Looking at the history of an image
Deleting an image
Exporting an image
Importing an image
Building images using Dockerfiles
Building an Apache image – a Dockerfile example
Accessing Firefox from a container – a Dockerfile example
Building a WordPress image – a Dockerfile example
Setting up a private index/registry
Automated builds – with GitHub and Bitbucket
Creating the base image – using supermin
Creating the base image – using Debootstrap
Visualizing dependencies between layers
Chapter 4: Network and Data Management for Containers
Introduction
Accessing containers from outside
Managing data in containers
Linking two or more containers
Developing a LAMP application by linking containers
Networking of multihost containers with Flannel
Assigning IPv6 addresses to containers
Chapter 5: Docker Use Cases
Introduction
Testing with Docker
Doing CI/CD with Shippable and Red Hat OpenShift
Doing CI/CD with Drone
Setting up PaaS with OpenShift Origin
Building and deploying an app on OpenShift v3 from the source code
Configuring Docker as a hypervisor driver for OpenStack
Chapter 6: Docker APIs and Language Bindings
Introduction
Configuring the Docker daemon remote API
Performing image operations using remote APIs
Performing container operations using remote APIs
Exploring Docker remote API client libraries
Securing the Docker daemon remote API
Chapter 7: Docker Performance
Introduction
Benchmarking CPU performance
Benchmarking disk performance
Benchmarking network performance
Getting container resource usage using the stats feature
Setting up performance monitoring
Chapter 8: Docker Orchestration and Hosting Platforms
Introduction
Running applications with Docker Compose
Setting up cluster with Docker Swarm
Setting up CoreOS for Docker orchestration
Setting up a Project Atomic host
Doing atomic update/rollback with Project Atomic
Adding more storage for Docker in Project Atomic
Setting up Cockpit for Project Atomic
Setting up a Kubernetes cluster
Scaling up and down in a Kubernetes cluster
Setting up WordPress with a Kubernetes cluster
Chapter 9: Docker Security
Introduction
Setting Mandatory Access Control (MAC) with SELinux
Allowing writes to volume mounted from the host with SELinux ON
Removing capabilities to breakdown the power of a root user inside a container
Sharing namespaces between the host and the container
Chapter 10: Getting Help and Tips and Tricks
Introduction
Starting Docker in debug mode
Building a Docker binary from the source
Building images without using cached layers
Building your own bridge for container communication
Changing the default execution driver of Docker
Selecting the logging driver for containers
Getting real-time Docker events for containers

What You Will Learn

  • Install and set up Docker on different environments
  • Work with Docker images and containers to Dockerize applications
  • Create services with Docker to enable the swift development and deployment of applications
  • Make optimum use of Docker in a testing environment do complete CI/CD
  • Plan efficient working with Docker APIs, orchestration, and hosting platform such as Project Atomic
  • Learn the various use cases available for Docker
  • Troubleshoot, maintain, and optimize your Docker services effectively

Authors

Table of Contents

Chapter 1: Introduction and Installation
Introduction
Verifying the requirements for Docker installation
Installing Docker
Pulling an image and running a container
Adding a nonroot user to administer Docker
Setting up the Docker host with Docker Machine
Finding help with the Docker command line
Chapter 2: Working with Docker Containers
Introduction
Listing/searching for an image
Pulling an image
Listing images
Starting a container
Listing containers
Looking at the logs of containers
Stopping a container
Deleting a container
Setting the restart policy on a container
Getting privileged access inside a container
Exposing a port while starting a container
Accessing the host device inside the container
Injecting a new process to a running container
Returning low-level information about a container
Labeling and filtering containers
Chapter 3: Working with Docker Images
Introduction
Creating an account with Docker Hub
Creating an image from the container
Publishing an image to the registry
Looking at the history of an image
Deleting an image
Exporting an image
Importing an image
Building images using Dockerfiles
Building an Apache image – a Dockerfile example
Accessing Firefox from a container – a Dockerfile example
Building a WordPress image – a Dockerfile example
Setting up a private index/registry
Automated builds – with GitHub and Bitbucket
Creating the base image – using supermin
Creating the base image – using Debootstrap
Visualizing dependencies between layers
Chapter 4: Network and Data Management for Containers
Introduction
Accessing containers from outside
Managing data in containers
Linking two or more containers
Developing a LAMP application by linking containers
Networking of multihost containers with Flannel
Assigning IPv6 addresses to containers
Chapter 5: Docker Use Cases
Introduction
Testing with Docker
Doing CI/CD with Shippable and Red Hat OpenShift
Doing CI/CD with Drone
Setting up PaaS with OpenShift Origin
Building and deploying an app on OpenShift v3 from the source code
Configuring Docker as a hypervisor driver for OpenStack
Chapter 6: Docker APIs and Language Bindings
Introduction
Configuring the Docker daemon remote API
Performing image operations using remote APIs
Performing container operations using remote APIs
Exploring Docker remote API client libraries
Securing the Docker daemon remote API
Chapter 7: Docker Performance
Introduction
Benchmarking CPU performance
Benchmarking disk performance
Benchmarking network performance
Getting container resource usage using the stats feature
Setting up performance monitoring
Chapter 8: Docker Orchestration and Hosting Platforms
Introduction
Running applications with Docker Compose
Setting up cluster with Docker Swarm
Setting up CoreOS for Docker orchestration
Setting up a Project Atomic host
Doing atomic update/rollback with Project Atomic
Adding more storage for Docker in Project Atomic
Setting up Cockpit for Project Atomic
Setting up a Kubernetes cluster
Scaling up and down in a Kubernetes cluster
Setting up WordPress with a Kubernetes cluster
Chapter 9: Docker Security
Introduction
Setting Mandatory Access Control (MAC) with SELinux
Allowing writes to volume mounted from the host with SELinux ON
Removing capabilities to breakdown the power of a root user inside a container
Sharing namespaces between the host and the container
Chapter 10: Getting Help and Tips and Tricks
Introduction
Starting Docker in debug mode
Building a Docker binary from the source
Building images without using cached layers
Building your own bridge for container communication
Changing the default execution driver of Docker
Selecting the logging driver for containers
Getting real-time Docker events for containers

Book Details

ISBN 139781783984862
Paperback248 pages
Read More
From 1 reviews

Read More Reviews