Mastering Docker, Fourth Edition
eBook - ePub

Mastering Docker, Fourth Edition

Russ McKendrick

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

Mastering Docker, Fourth Edition

Russ McKendrick

Book details
Book preview
Table of contents
Citations

About This Book

Unlock the full potential of the Docker containerization platform with this practical guide

Key Features

  • Explore tools such as Docker Engine, Machine, Compose, and Swarm
  • Discover how you can integrate Docker into your everyday workflows
  • Get well-versed with Kubernetes options such as Minikube, Kind, and MicroK8s

Book Description

Docker has been a game changer when it comes to how modern applications are deployed and created. It has now grown into a key driver of innovation beyond system administration, with a significant impact on the world of web development. Mastering Docker shows you how you can ensure that you're keeping up with the innovations it's driving and be sure you're using it to its full potential. This fourth edition not only demonstrates how to use Docker more effectively but also helps you rethink and reimagine what you can achieve with it.You'll start by building, managing, and storing images along with exploring best practices for working with Docker confidently. Once you've got to grips with Docker security, the book covers essential concepts for extending and integrating Docker in new and innovative ways. You'll also learn how to take control of your containers efficiently using Docker Compose, Docker Swarm, and Kubernetes.By the end of this Docker book, you'll have a broad yet detailed sense of what's possible with Docker and how seamlessly it fits in with a range of other platforms and tools.

What you will learn

  • Get to grips with essential Docker components and concepts
  • Discover the best ways to build, store, and distribute container images
  • Understand how Docker can fit into your development workflow
  • Secure your containers and files with Docker s security features
  • Explore first-party and third-party cluster tools and plugins
  • Launch and manage your Kubernetes clusters in major public clouds

Who this book is for

If you are a software architect, DevOps engineer, sysadmin, or IT professional looking to leverage Docker's extensive features for innovating any process from system administration to web development, Mastering Docker will show you how you can use it to its full potential. A basic understanding of containerization and prior Docker experience is necessary.

]]>

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
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.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
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.
Do you support text-to-speech?
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.
Is Mastering Docker, Fourth Edition an online PDF/ePUB?
Yes, you can access Mastering Docker, Fourth Edition by Russ McKendrick in PDF and/or ePUB format, as well as other popular books in Computer Science & Systems Architecture. We have over one million books available in our catalogue for you to explore.

Information

Year
2020
ISBN
9781839213519

Section 1: Getting Up and Running with Docker

In this section, you will learn how to install, configure, and use Docker to launch both simple and complex containerized applications on a local machine.
This section comprises the following chapters:
Chapter 1,Ā Docker Overview
Chapter 2,Ā Building Container Images
Chapter 3,Ā Storing and Distributing Images
Chapter 4, Managing Containers
Chapter 5, Launching Multiple Containers Using Docker Compose
Chapter 6, Using Docker Machine,Vagrant, and Multipass

Chapter 1: Docker Overview

Welcome to Mastering Docker, Fourth Edition! This first chapter will cover the Docker basics that you should already have a pretty good handle on. But if you don't already have the required knowledge at this point, this chapter will help you get up to speed, so that subsequent chapters don't feel as heavy.
By the end of the book, you will be a Docker master able to implement Docker in your environments, building and supporting applications on top of them.
In this chapter, we're going to review the following:
  • Understanding Docker
  • The differences between dedicated hosts, virtual machines, and Docker installers/installation
  • The Docker command
  • The Docker and container ecosystem

Technical requirements

In this chapter, we are going to discuss how to install Docker locally. To do this, you will need a host running one of the three following operating systems:
  • macOS High Sierra and above
  • Windows 10 Professional
  • Ubuntu 18.04 and above
  • Check out the following video to see the Code in Action: https://bit.ly/35fytE3

Understanding Docker

Before we look at installing Docker, let's begin by getting an understanding of the problems that the Docker technology aims to solve.

Developers

The company behind Docker, also called Docker, has always described the program as fixing the 'it works on my machine' problem. This problem is best summed up by an image, based on the Disaster Girl meme, which simply had the tagline 'Worked fine in dev, ops problem now', that started popping up in presentations, forums, and Slack channels a few years ago. While it is funny, it is, unfortunately, an all-too-real problem and one I have personally been on the receiving end of, let's take a look at an example of what is meant by this.

The problem

Even in a world where DevOps best practices are followed, it is still all too easy for a developer's working environment to not match the final production environment.
For example, a developer using the macOS version of, say, PHP will probably not be running the same version as the Linux server that hosts the production code. Even if the versions match, you then have to deal with differences in the configuration and overall environment on which the version of PHP is running, such as differences in the way file permissions are handled between different operating system versions, to name just one potential problem.
All of this comes to a head when it is time for a developer to deploy their code to the host, and it doesn't work. So, should the production environment be configured to match the developer's machine, or should developers only do their work in environments that match those used in production?
In an ideal world, everything should be consistent, from the developer's laptop all the way through to your production servers; however, this utopia has traditionally been challenging to achieve. Everyone has their way of working and their own personal preferencesā€”enforcing consistency across multiple platforms is difficult enough when a single engineer is working on the systems, let alone a team of engineers working with a team of potentially hundreds of developers.
The Docker solution
Using Docker for Mac or Docker for Windows, a developer can quickly wrap their code in a container that they have either defined themselves or created as a Dockerfile while working alongside a sysadmin or operations team. We will be covering this in Chapter 2, Building Container Images, as well as Docker Compose files, which we will go into more detail about in Chapter 5, Docker Compose.
Programmers can continue to use their chosen integrated development environment (IDE) and maintain their workflows when working with the code. As we will see in the upcoming sections of this chapter, installing and using Docker is not difficult; considering how much of a chore it was to maintain consistent environments in the past, even with automation, Docker feels a little too easy ā€“ almost like cheating.

Operators

I have been working in operations for more years than I would like to admit, and the following problem has cropped regularly.

The problem

Let's say you are looking after five servers: three load-balanced web servers and two database servers that are in a master or slave configuration dedicated to running Application 1. You are using a tool, such as Puppet or Chef, to automatically manage the software stack and configuration across your five servers.
Everything is going great until you are told that we need to deploy Application 2 on the same servers that are running Application 1. On the face of it, this is not a problem ā€“ you can tweak your Puppet or Chef configuration to add new users, add virtual hosts, pull the latest code down, and so on. However, you notice that Application 2 requires a newer version of the software than the one you are running for Application 1.
To make matters worse, you already know that Application 1 flat out refuses to work with the new software stack and that Application 2 is not backward compatible.
Traditionally, this leaves you with a ...

Table of contents

  1. Mastering Docker, Fourth Edition
  2. Why subscribe?
  3. Preface
  4. Section 1: Getting Up and Running with Docker
  5. Chapter 1: Docker Overview
  6. Chapter 2: Building Container Images
  7. Chapter 3: Storing and Distributing Images
  8. Chapter 4: Managing Containers
  9. Chapter 5: Docker Compose
  10. Chapter 6: Docker Machine, Vagrant, and Multipass
  11. Section 2: Clusters and Clouds
  12. Chapter 7: Moving from Linux to Windows Containers
  13. Chapter 8: Clustering with Docker Swarm
  14. Chapter 9: Portainer ā€“ A GUI for Docker
  15. Chapter 10: Running Docker in Public Clouds
  16. Chapter 11: Docker and Kubernetes
  17. Chapter 12: Discovering other Kubernetes options
  18. Chapter 13: Running Kubernetes in Public Clouds
  19. Section 3: Best Practices
  20. Chapter 14: Docker Security
  21. Chapter 15: Docker Workflows
  22. Chapter 16: Next Steps with Docker
  23. Assessments
  24. Other Books You May Enjoy
Citation styles for Mastering Docker, Fourth Edition

APA 6 Citation

McKendrick, R. (2020). Mastering Docker - Fourth Edition (4th ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/1978233/mastering-docker-fourth-edition-pdf (Original work published 2020)

Chicago Citation

McKendrick, Russ. (2020) 2020. Mastering Docker - Fourth Edition. 4th ed. Packt Publishing. https://www.perlego.com/book/1978233/mastering-docker-fourth-edition-pdf.

Harvard Citation

McKendrick, R. (2020) Mastering Docker - Fourth Edition. 4th edn. Packt Publishing. Available at: https://www.perlego.com/book/1978233/mastering-docker-fourth-edition-pdf (Accessed: 15 October 2022).

MLA 7 Citation

McKendrick, Russ. Mastering Docker - Fourth Edition. 4th ed. Packt Publishing, 2020. Web. 15 Oct. 2022.