Docker in Practice, Second Edition
eBook - ePub

Docker in Practice, Second Edition

  1. 384 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Docker in Practice, Second Edition

About this book

Summary Docker in Practice, Second Edition presents over 100 practical techniques, hand-picked to help you get the most out of Docker. Following a Problem/Solution/Discussion format, you'll walk through specific examples that you can use immediately, and you'll get expert guidance on techniques that you can apply to a whole range of scenarios.Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the Technology Docker's simple idea-wrapping an application and its dependencies into a single deployable container-created a buzz in the software industry. Now, containers are essential to enterprise infrastructure, and Docker is the undisputed industry standard. So what do you do after you've mastered the basics? To really streamline your applications and transform your dev process, you need relevant examples and experts who can walk you through them. You need this book. About the Book Docker in Practice, Second Edition teaches you rock-solid, tested Docker techniques, such as replacing VMs, enabling microservices architecture, efficient network modeling, offline productivity, and establishing a container-driven continuous delivery process. Following a cookbook-style problem/solution format, you'll explore real-world use cases and learn how to apply the lessons to your own dev projects. What's inside

  • Continuous integration and delivery
  • The Kubernetes orchestration tool
  • Streamlining your cloud workflow
  • Docker in swarm mode
  • Emerging best practices and techniques


About the Reader Written for developers and engineers using Docker in production. About the Author Ian Miell and Aidan Hobson Sayers are seasoned infrastructure architects working in the UK. Together, they used Docker to transform DevOps at one of the UK's largest gaming companies. Table of Contents

PART 1 - DOCKER FUNDAMENTALS

  • Discovering Docker
  • Understanding Docker: Inside the engine room

PART 2 - DOCKER AND DEVELOPMENT

  • Using Docker as a lightweight virtual machine
  • Building images
  • Running containers
  • Day-to-day Docker
  • Configuration management: Getting your house in order

PART 3 - DOCKER AND DEVOPS

  • Continuous integration: Speeding up your development pipeline
  • Continuous delivery: A perfect fit for Docker principles
  • Network simulation: Realistic environment testing without the pain

PART 4 - ORCHESTRATION FROM A SINGLE MACHINE TO THE CLOUD

  • A primer on container orchestration
  • The data center as an OS with Docker
  • Docker platforms

PART 5 - DOCKER IN PRODUCTION

  • Docker and security
  • Plain sailing: Running Docker in production
  • Docker in production: Dealing with challenges

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Docker in Practice, Second Edition by Ian Miell,Aidan Sayers in PDF and/or ePUB format, as well as other popular books in Computer Science & Software Development. We have over one million books available in our catalogue for you to explore.

Information

Part 1. Docker fundamentals

Part 1 of this book consists of chapters 1 and 2, which get you started using Docker and cover its fundamentals.
Chapter 1 explains the origin of Docker along with its core concepts, such as images, containers, and layering. Finally, you’ll get your hands dirty by creating your first image with a Dockerfile.
Chapter 2 introduces some useful techniques to give you a deeper understanding of Docker’s architecture. Taking each major component in turn, we’ll cover the relationship between the Docker daemon and its client, the Docker registry, and the Docker Hub.
By the end of part 1 you’ll be comfortable with core Docker concepts and will be able to demonstrate some useful techniques, laying a firm foundation for the remainder of the book.

Chapter 1. Discovering Docker

This chapter covers
  • What Docker is
  • The uses of Docker and how it can save you time and money
  • The differences between containers and images
  • Docker’s layering feature
  • Building and running a to-do application using Docker
Docker is a platform that allows you to “build, ship, and run any app, anywhere.” It has come a long way in an incredibly short time and is now considered a standard way of solving one of the costliest aspects of software: deployment.
Before Docker came along, the development pipeline typically involved combinations of various technologies for managing the movement of software, such as virtual machines, configuration management tools, package management systems, and complex webs of library dependencies. All these tools needed to be managed and maintained by specialist engineers, and most had their own unique ways of being configured.
Docker has changed all of this, allowing different engineers involved in this process to effectively speak one language, making working together a breeze. Everything goes through a common pipeline to a single output that can be used on any target—there’s no need to continue maintaining a bewildering array of tool configurations, as shown in figure 1.1.
Figure 1.1. How Docker has eased the tool maintenance burden
At the same time, there’s no need to throw away your existing software stack if it works for you—you can package it up in a Docker container as-is, for others to consume. As a bonus, you can see how these containers were built, so if you need to dig into the details, you can.
This book is aimed at intermediate developers with some knowledge of Docker. If you’re OK with the basics, feel free to skip to the later chapters. The goal of this book is to expose the real-world challenges that Docker brings and to show how they can be overcome. But first we’re going to provide a quick refresher on Docker itself. If you want a more thorough treatment of Docker’s basics, take a look at Docker in Action by Jeff Nickoloff (Manning, 2016).
In chapter 2 you’ll be introduced to Docker’s architecture more deeply, with the aid of some techniques that demonstrate its power. In this chapter you’re going to learn what Docker is, see why it’s important, and start using it.

1.1. The what and why of Docker

Before we get our hands dirty, we’ll discuss Docker a little so that you understand its context, where the name “Docker” came from, and why we’re using it at all!

1.1.1. What is Docker?

To get an understanding of what Docker is, it’s easier to start with a metaphor than a technical explanation, and the Docker metaphor is a powerful one. A docker was a laborer who moved commercial goods into and out of ships when they docked at ports. There were boxes and items of differing sizes and shapes, and experienced dockers were prized for their ability to fit goods into ships by hand in cost-effective ways (see figure 1.2). Hiring people to move stuff around wasn’t cheap, but there was no alternative. This should sound familiar to anyone working in software. Much time and intellectual energy is spent getting metaphorically odd-shaped software into differently-sized metaphorical ships full of other odd-shaped software, so they can be sold to users or businesses elsewhere.
Figure 1.2. Shipping before and after standardized containers
Figure 1.3 shows how time and money can be saved with the Docker concept. Before Docker, deploying software to different environments required significant effort. Even if you weren’t hand-running scripts to provision software on different machines (and plenty of people do exactly that), you’d still have to wrestle with configuration management tools that manage state on what are increasingly fast-moving environments starved of resources. Even when these efforts were encapsulated in VMs, a lot of time was spent managing the deployment of these VMs, waiting for them to boot, and managing the overhead of resource use they created.
Figure 1.3. Software delivery before and after Docker
With Docker, the configuration effort is separated from the resource management, and the deployment effort is trivial: run docker run, and the environment’s image is pulled down and ready to run, consuming fewer resources and contained so that it doesn’t interfere with other environments.
You don’t need to worry about whether your container is going to be shipped to a Red Hat machine, an Ubuntu machine, or a CentOS VM image; as long as it has Docker on it, it’ll be good to go.

1.1.2. What is Docker good for?

Some crucial practical questions arise: why would you u...

Table of contents

  1. Copyright
  2. Brief Table of Contents
  3. Table of Contents
  4. Praise for the First Edition
  5. Preface
  6. Acknowledgments
  7. About this book
  8. About the cover illustration
  9. Part 1. Docker fundamentals
  10. Part 2. Docker and development
  11. Part 3. Docker and DevOps
  12. Part 4. Orchestration from a single machine to the cloud
  13. Part 5. Docker in production
  14. Appendix A. Installing and using Docker
  15. Appendix B. Docker configuration
  16. Appendix C. Vagrant
  17. Index
  18. List of Figures
  19. List of Tables
  20. List of Listings