O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Orchestrating Docker

Book Description

Manage and deploy Docker services to containerize applications efficiently

In Detail

Docker is growing in popularity by day because of its great utility, the fact that it's user friendly, and the vibrant community.

This book will help you transform the way you build, test, and deploy your applications with Docker, making it easier and enjoyable. The book starts off with the installation of Docker before gradually taking you through the different commands to start working with Docker containers and their services. You will learn to build your own Docker containers along with instructions to fine-tune the resource allocations to those containers. You will then learn to manage a cluster of Docker containers. The book demonstrates the processes related to the automation and orchestration of Docker. It then covers the compatibility of Docker with other technologies such as Puppet and Chef. Finally, it prepares you to ship your applications without taking strain for deployment. By the end of the book, you will be able to orchestrate and manage the creation and deployment of Docker containers.

What You Will Learn

  • Get familiar with the processes related to the automation of Docker
  • Get to grips with various Docker commands and techniques that help you manage containers
  • Create your own Docker image and package your web application in the image
  • Use Dockerfile DSL to make your Docker images repeatable
  • Deploy a high availability service on a cluster using CoreOS and fleet
  • Build your application in sandboxed Docker containers

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Orchestrating Docker
    1. Table of Contents
    2. Orchestrating Docker
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Unboxing Docker
      1. Installing Docker
        1. Installing Docker in Ubuntu
          1. Installing Docker in Ubuntu Trusty 14.04 LTS
          2. Installing Docker in Ubuntu Precise 12.04 LTS
        2. Upgrading Docker
        3. Mac OSX and Windows
          1. Upgrading Boot2Docker
      2. OpenStack
        1. Installation with DevStack
        2. Installing Docker for OpenStack manually
        3. Nova configuration
        4. Glance configuration
        5. Docker-OpenStack flow
      3. Inception: Build Docker in Docker
        1. Dependencies
        2. Building Docker from source
      4. Verifying Installation
      5. Useful tips
        1. Giving non-root access
        2. UFW settings
      6. Summary
    9. 2. Docker CLI and Dockerfile
      1. Docker terminologies
        1. Docker container
        2. The docker daemon
        3. Docker client
        4. Dockerfile
        5. Docker registry
      2. Docker commands
        1. The daemon command
        2. The version command
        3. The info command
        4. The run command
          1. Running a server
        5. The search command
        6. The pull command
        7. The start command
        8. The stop command
        9. The restart command
        10. The rm command
        11. The ps command
        12. The logs command
        13. The inspect command
        14. The top command
        15. The attach command
        16. The kill command
        17. The cp command
        18. The port command
      3. Running your own project
        1. The diff command
        2. The commit command
        3. The images command
        4. The rmi command
        5. The save command
        6. The load command
        7. The export command
        8. The import command
        9. The tag command
        10. The login command
        11. The push command
        12. The history command
        13. The events command
        14. The wait command
        15. The build command
        16. Uploading to Docker daemon
      4. Dockerfile
        1. The FROM instruction
        2. The MAINTAINER instruction
        3. The RUN instruction
        4. The CMD instruction
        5. The ENTRYPOINT instruction
        6. The WORKDIR instruction
        7. The EXPOSE instruction
        8. The ENV instruction
        9. The USER instruction
        10. The VOLUME instruction
        11. The ADD instruction
        12. The COPY instruction
        13. The ONBUILD instruction
      5. Docker workflow - pull-use-modify-commit-push
      6. Automated Builds
        1. Build triggers
        2. Webhooks
      7. Summary
    10. 3. Configuring Docker Containers
      1. Constraining resources
        1. Setting CPU share
        2. Setting memory limit
        3. Setting a storage limit on the virtual filesystem (Devicemapper)
          1. Devicemapper configurations
      2. Managing data in containers with volumes
        1. Data-only container
        2. Using volumes from another container
        3. Use case – MongoDB in production on Docker
      3. Configuring Docker to use a different storage driver
        1. Using devicemapper as the storage driver
        2. Using btrfs as the storage driver
      4. Configuring Docker's network settings
        1. Configuring port forwarding between container and host
        2. Custom IP address range
      5. Linking containers
        1. Linking containers within the same host
        2. Cross-host linking using ambassador containers
          1. Use case - a multi-host Redis environment
            1. Host 1
            2. Host 2
      6. Summary
    11. 4. Automation and Best Practices
      1. Docker remote API
        1. Remote API for containers
          1. The create command
          2. The list command
        2. Remote API for images
          1. Listing the local Docker images
        3. Other operations
          1. Getting system-wide information
          2. Committing an image from a container
          3. Saving the image
        4. How docker run works
      2. Injecting processes into containers with the Docker execute command
      3. Service discovery
        1. Using Docker names, links, and ambassador containers
          1. Using links to make containers visible to each other
          2. Cross-host linking using ambassador containers
        2. Service discovery using etcd
        3. Docker Orchestration
        4. Docker Machine
        5. Swarm
        6. Docker Compose
      4. Security
        1. Kernel namespaces
        2. Control groups
        3. The root in a container
        4. Docker daemon attack surface
        5. Best practices for security
      5. Summary
    12. 5. Friends of Docker
      1. Using Docker with Chef and Puppet
        1. Using Docker with Chef
          1. Installing and configuring Docker
          2. Writing a Chef recipe to run Code.it on Docker
        2. Using Docker with Puppet
          1. Writing a Puppet manifest to run Code.it on Docker
      2. Setting up an apt-cacher
        1. Using the apt-cacher while building your Dockerfiles
      3. Setting up your own mini-Heroku
        1. Installing Dokku using a bootstrapper script
        2. Installing Dokku using Vagrant
        3. Configuring a hostname and adding the public key
        4. Deploying an application
      4. Setting up a highly available service
        1. Installing dependencies
        2. Getting and configuring the Vagrantfile
          1. Getting discovery tokens
          2. Setting the number of instances
          3. Spawning instances and verifying health
          4. Starting the service
      5. Summary
    13. Index