0%

Book Description

Unlock new opportunities using Docker's most advanced features.

About This Book

  • Experience first- and third-party tools such as Docker Compose, Docker Machine, Portainer, and Rancher
  • Learn how to leverage Kubernetes, Amazon ECS, and Docker Swarm and know when each solution is appropriate
  • Discover how Docker can be integrated into your daily workflows

Who This Book Is For

If you are an I.T Professional and recognize Docker's importance for innovation in everything from system administration to web development, but aren't sure how to use it to its full potential, this book is for you.

What You Will Learn

  • Become fluent in the basic components and concepts of Docker
  • Secure your containers and files with Docker's security features
  • Extend Docker and solve architectural problems using first- and third-party orchestration tools, service discovery, and plugins
  • Leverage the Linux container virtualization paradigm by creating highly scalable applications

In Detail

Docker has been a game-changer when it comes to how modern applications are deployed and architectured. It has now grown into a key driver of innovation beyond system administration, with an impact on the world of web development and more. But how can you make sure you're keeping up with the innovations it's driving

This book shows you how; it not only demonstrates how to use Docker more effectively, it also helps you rethink and reimagine what's possible with Docker.

You will also cover basic topics such as building, managing and storing images along with best practices to make you confident before delving more deeply into Docker security.

You'll find everything related to extending and integrating Docker in new and innovative ways. Docker Swarm and Docker Compose will help you take control of your containers in an efficient way.

By the end of the book, you will have a broad and detailed sense of exactly what's possible with Docker and how seamlessly it fits in with a range of other platforms and tools.

Style and approach

A clear, concise, and straightforward book to make you a Master in Docker by including topics such as extending and integrating Docker along with different Docker tools, in a way that's accessible and practical. This book has been created to help you put new ideas into practice, and to demonstrate precisely what's possible with Docker.

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. Title Page
    1. Mastering Docker
      1. Second Edition
  2. Copyright
    1. Mastering Docker
      1. Second Edition
  3. Credits
  4. About the Authors
  5. About the Reviewers
  6. www.PacktPub.com
    1. Why subscribe?
  7. Customer Feedback
  8. 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
  9. Docker Overview
    1. Understanding Docker
      1. Developers
        1. The problem
        2. The Docker solution
      2. Operators
        1. The problem
        2. The Docker solution
      3. Enterprise
        1. The problem
        2. The Docker solution
    2. Differences between dedicated hosts, virtual machines, and Docker
    3. Docker installers/installation
      1. Installing on Linux (Ubuntu 16.04)
      2. Installing on macOS
      3. Installing on Windows 10 Professional
      4. Older operating systems
    4. The Docker command-line client
    5. The Docker ecosystem
    6. Summary
  10. Building Container Images
    1. Introducing the Dockerfile
      1. Reviewing the Dockerfile in depth
        1. FROM
        2. LABEL
        3. RUN
        4. COPY and ADD
        5. EXPOSE
        6. ENTRYPOINT and CMD
        7. Other Dockerfile commands
          1. USER
          2. WORKDIR
          3. ONBUILD
          4. ENV
      2. Dockerfiles – best practices
    2. Building Docker images
      1. The docker build command
        1. Build an image from a Dockerfile
          1. .dockerignore
      2. Building custom images using Dockerfiles
      3. Using an existing container
      4. Building from scratch
    3. Environmental variables
      1. Using environmental variables in your Dockerfile
    4. Putting it all together
    5. Summary
  11. Storing and Distributing Images
    1. Docker Hub
      1. Dashboard
      2. Explore
      3. Organizations
      4. Create
      5. Profile and settings
      6. The Stars page
      7. Creating an automated build
        1. Setting up your code
        2. Setting up Docker Hub
      8. Pushing your own image
    2. Docker Store
    3. Docker Registry
      1. An overview of Docker Registry
      2. Deploying your own registry
      3. Docker Trusted Registry
    4. Third-party registries
      1. Quay
      2. Amazon EC2 Container Registry
    5. Microbadger
    6. Summary
  12. Managing Containers
    1. Docker container commands
      1. The basics
      2. Interacting with your containers
        1. Attach
        2. exec
      3. Logs and process information
        1. logs
        2. top
        3. stats
      4. Resource limits
      5. Container states and miscellaneous commands
        1. Pause and unpause
        2. Stop, start, restart, and kill
      6. Removing containers
        1. Miscellaneous commands
    2. Docker networking and volumes
      1. Docker networking
      2. Docker volumes
    3. Summary
  13. Docker Machine
    1. An introduction to Docker Machine
    2. Deploying local Docker hosts with Docker Machine
    3. Launching Docker hosts in the cloud
      1. DigitalOcean
      2. Amazon Web Services
    4. More Docker networking
    5. Using other base operating systems
      1. CoreOS on DigitalOcean
      2. RancherOS on VirtualBox
    6. Summary
  14. Docker Compose
    1. Introducing Docker Compose
    2. Our Docker Compose application
    3. Docker Compose YAML file
      1. Mobycounter YAML
      2. The voting application
    4. Docker Compose commands
      1. Up and PS
      2. Config
      3. Pull, build, and create
      4. Start, stop, restart, pause, and unpause
      5. Top, logs, and events
      6. Exec and run
      7. Scale
      8. Kill, rm, and down
    5. Summary
  15. Docker Swarm
    1. Installing Docker Swarm
    2. Docker Swarm roles
      1. Swarm manager
      2. Swarm worker
    3. Using Docker Swarm
      1. Creating a cluster
      2. Joining workers
      3. Listing nodes
      4. Managing a cluster
      5. Promoting a worker node
      6. Demoting a manager node
      7. Draining a node
    4. Docker Swarm services and stacks
      1. Services
      2. Stacks
    5. Deleting a Swarm cluster
    6. Load balancing, overlays, and scheduling
      1. Ingress load balancing
      2. Network overlays
      3. Scheduling
    7. Summary
  16. Portainer
    1. The road to Portainer
    2. Getting Portainer up and running
    3. Using Portainer
      1. The Dashboard
      2. Application templates
      3. Containers
        1. Stats
        2. Logs
        3. Console
      4. Images
      5. Networks and volumes
        1. Networks
        2. Volumes
      6. Events
      7. Docker
    4. Portainer and Docker Swarm
      1. Creating the Swarm
      2. The Portainer service
      3. Swarm differences
        1. Dashboard
        2. Swarm
        3. Services
        4. Endpoints
    5. Summary
  17. Rancher
    1. Installing and configuring authentication
      1. Installation
      2. Configuring authentication
    2. Creating a herd
    3. Launching stacks
      1. User Defined Stacks
      2. Container view
      3. Catalog
    4. Removing the herd
    5. Other cluster options
    6. Summary
  18. Docker Cloud
    1. Creating an account
    2. Linking your accounts
      1. DigitalOcean
      2. Amazon Web Services
    3. Launching nodes
    4. Launching a stack
    5. Swarm mode
    6. Docker for AWS
    7. Summary
  19. Docker Security
    1. Container considerations
      1. The advantages
      2. Your Docker host
      3. Image trust
    2. Docker commands
      1. Run
      2. Diff
    3. Best practices
      1. Docker - best practices
      2. The Center for Internet Security benchmark
        1. Host configuration
        2. Docker daemon configuration
        3. Docker daemon configuration files
        4. Container images/runtime and build files
        5. Container runtime
        6. Docker security operations
    4. The Docker Bench Security application
      1. Running on Docker for macOS and Docker for Windows
      2. Running on Ubuntu Linux
      3. Understanding the output
        1. Host configuration
        2. Docker daemon configuration
        3. Docker daemon configuration files
        4. Container images and build files
        5. Container runtime
        6. Docker security operations
      4. Summing up Docker Bench
    5. Docker security scanning
    6. Third-party security services
      1. Quay
      2. Clair
    7. Summary
  20. Docker Workflows
    1. Docker for development
    2. Monitoring
    3. Extending to external platforms
      1. Tectonic
      2. Heroku
      3. Amazon Elastic Container Service
    4. What does production look like?
      1. Docker hosts
        1. Mixing of processes
        2. Multiple isolated Docker hosts
        3. Routing to your containers
      2. Clustering
        1. Compatibility
        2. Reference architectures
        3. Cluster communication
      3. Image registries
    5. Summary
  21. Next Steps with Docker
    1. Service discovery
      1. Consul
        1. Running Consul
        2. Running Registrator
        3. Querying Consul
        4. Consul template
        5. Highly available Consul
      2. etcd
      3. Docker API
    2. The Moby Project
    3. Contributing to Docker
      1. Contributing to the code
      2. Offering Docker support
      3. Other contributions
    4. Summary