You are previewing Extending Docker.
O'Reilly logo
Extending Docker

Book Description

Master the art of making Docker more extensible, composable, and modular by leveraging plugins and other supporting tools

About This Book

  • Get the first book on the market that shows you how to extend the capabilities of Docker using plugins and third-party tools

  • Master the skills of creating various plugins and integrating great tools in order to enhance the functionalities of Docker

  • A practical and learning guide that ensures your investment in Docker becomes more valuable

  • Who This Book Is For

    This book is for developers and sys admins who are well versed Docker and have knowledge on basic programming languages. If you can’t wait to extend Docker and customize it to meet your requirements, this is the book for you!

    What You Will Learn

  • Find out about Docker plugins and the problems they solve

  • Gain insights into creating your own plugin

  • Use Docker tools to extend the basic functionality of the core Docker engine

  • Get to grips with the installation and configuration of third-party tools available to use with Docker plugins

  • Install, configure, and use a scheduling service to manage the containers in your environment

  • Enhance your day-to-day Docker usage through security, troubleshooting, and best practices

  • In Detail

    With Docker, it is possible to get a lot of apps running on the same old servers, making it very easy to package and ship programs. The ability to extend Docker using plugins and load third-party plugins is incredible, and organizations can massively benefit from it.

    In this book, you will read about what first and third party tools are available to extend the functionality of your existing Docker installation and how to approach your next Docker infrastructure deployment. We will show you how to work with Docker plugins, install it, and cover its lifecycle. We also cover network and volume plugins, and you will find out how to build your own plugin.

    You’ll discover how to integrate it with Puppet, Ansible, Jenkins, Flocker, Rancher, Packer, and more with third-party plugins. Then, you’ll see how to use Schedulers such as Kubernetes and Amazon ECS. Finally, we’ll delve into security, troubleshooting, and best practices when extending Docker.

    By the end of this book, you will learn how to extend Docker and customize it based on your business requirements with the help of various tools and plugins.

    Style and approach

    An easy to follow guide with plenty of hands-on practical examples which can be executed both on your local machine or externally hosted services.

    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 code file.

    Table of Contents

    1. Extending Docker
      1. Table of Contents
      2. Extending Docker
      3. Credits
      4. About the Author
      5. About the Reviewer
      6. www.PacktPub.com
        1. eBooks, discount offers, and more
          1. Why subscribe?
      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. Errata
          3. Piracy
          4. Questions
      8. 1. Introduction to Extending Docker
        1. The rise of Docker
          1. Dedicated machines
          2. Virtual machines
          3. Dedicated versus virtual machines
          4. Containers
        2. Everyone should be using Docker?
        3. Life cycle of a container
          1. Installing Docker
        4. What are the limits?
        5. Summary
      9. 2. Introducing First-party Tools
        1. Docker Toolbox
          1. Why install Docker locally?
          2. Installing Docker Toolbox
        2. Docker Machine
          1. Developing locally
          2. Heading into the cloud
            1. The DigitalOcean driver
            2. The Amazon Web Services driver
          3. Other considerations
        3. Docker Swarm
          1. Creating a local cluster
          2. Creating a Remote Cluster
          3. Discovery backends
        4. Docker Compose
          1. Why Compose?
          2. Compose files
          3. Launching more
        5. Summary
      10. 3. Volume Plugins
        1. Zero volumes
        2. The default volume driver
          1. Third-party volume drivers
            1. Installing Convoy
            2. Launching containers with a Convoy volume
            3. Creating a snapshot using Convoy
            4. Backing up our Convoy snapshot
            5. Restoring our Convoy backups
            6. Summing up Convoy
            7. Block volumes using REX-Ray
            8. Installing REX-Ray
            9. Moving the REX-Ray volume
            10. Summing up REX-Ray
          2. Flocker and Volume Hub
            1. Forming your Flock
            2. Deploying into the Flock
            3. Summing up Flocker
        3. Summary
      11. 4. Network Plugins
        1. Docker networking
        2. Multi-host networking with overlays
          1. Launching Discovery
          2. Readying the Swarm
          3. Adding the overlay network
          4. Using the overlay network
          5. Back to Consul
          6. Composing multi-host networks
          7. Summing up multi-host networking
        3. Weaving a network
          1. Configuring a Cluster again
          2. Installing and configuring Weave
          3. Docker Compose and Weave
          4. Weave Scope
          5. Calling off the Swarm
          6. Weavemesh Driver
          7. Summarizing Weave
        4. Summary
      12. 5. Building Your Own Plugin
        1. Third-party plugins
          1. Convoy
          2. REX-Ray
          3. Flocker
          4. Weave
          5. The commonalities among the plugins
        2. Understanding a plugin
          1. Discovery
          2. Startup order
          3. Activation
          4. API calls
        3. Writing your plugin service
        4. Summary
      13. 6. Extending Your Infrastructure
        1. Why use these tools?
        2. Puppetize all the things
          1. Docker and Puppet
          2. A more advanced Puppet example
          3. A final note about Puppet
        3. Orchestration with Ansible
          1. Preparation
          2. The playbook
            1. Section one
            2. Section Two
            3. Section three
            4. Section four
          3. Ansible and Puppet
        4. Vagrant (again)
          1. Provisioning using Vagrant
          2. The Vagrant Docker provider
        5. Packaging images
          1. An application
          2. The Docker way
          3. Building with Packer
          4. Packer versus Docker Build
          5. Image summary
        6. Serving up Docker with Jenkins
          1. Preparing the environment
          2. Creating an application
          3. Creating a pipeline
          4. Summing up Jenkins
        7. Summary
      14. 7. Looking at Schedulers
        1. Getting started with Kubernetes
          1. Installing Kubernetes
          2. Launching our first Kubernetes application
          3. An advanced example
            1. Creating the volumes
            2. Launching MySQL
            3. Launching WordPress
            4. Supporting tools
              1. Kubernetes Dashboard
              2. Grafana
              3. ELK
              4. Remaining cluster tools
          4. Destroying the cluster
          5. Recap
        2. Amazon EC2 Container Service (ECS)
          1. Launching ECS in the console
          2. Recap
        3. Rancher
          1. Installing Rancher
          2. Securing your Rancher installation
          3. Cattle cluster
          4. Deploying the Cluster application
          5. What's going on in the background?
          6. The catalog
            1. WordPress
            2. Storage
            3. Clustered database
            4. Looking at WordPress again
            5. DNS
          7. Docker & Rancher Compose
            1. Docker Compose
            2. Rancher Compose
          8. Back to where we started
          9. Removing the hosts
          10. Summing up Rancher
        4. Summary
      15. 8. Security, Challenges, and Conclusions
        1. Securing your containers
          1. Docker Hub
            1. Dockerfile
            2. Official images
            3. Pushed images
            4. Docker Cloud
            5. Private registries
        2. The challenges
          1. Development
          2. Staging
          3. Production
        3. Summary
      16. Index