Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Learn Docker - Fundamentals of Docker 19.x
Learn Docker - Fundamentals of Docker 19.x

Learn Docker - Fundamentals of Docker 19.x: Build, test, ship, and run containers with Docker and Kubernetes , Second Edition

Arrow left icon
Profile Icon Dr. Gabriel N. Schenker
Arrow right icon
R$50 per month
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8 (6 Ratings)
Paperback Mar 2020 592 pages 2nd Edition
eBook
R$80 R$196.99
Paperback
R$245.99
Subscription
Free Trial
Renews at R$50p/m
Arrow left icon
Profile Icon Dr. Gabriel N. Schenker
Arrow right icon
R$50 per month
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8 (6 Ratings)
Paperback Mar 2020 592 pages 2nd Edition
eBook
R$80 R$196.99
Paperback
R$245.99
Subscription
Free Trial
Renews at R$50p/m
eBook
R$80 R$196.99
Paperback
R$245.99
Subscription
Free Trial
Renews at R$50p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Learn Docker - Fundamentals of Docker 19.x

What Are Containers and Why Should I Use Them?

This first chapter will introduce you to the world of containers and their orchestration. This book starts from the very beginning, in that it assumes that you have no prior knowledge of containers, and will give you a very practical introduction to the topic.

In this chapter, we will focus on the software supply chain and the friction within it. Then, we'll present containers, which are used to reduce this friction and add enterprise-grade security on top of it. We'll also look into how containers and the ecosystem around them are assembled. We'll specifically point out the distinction between the upstream Open Source Software (OSS) components, united under the code name Moby, that form the building blocks of the downstream products of Docker and other vendors.

The chapter covers the following topics...

What are containers?

A software container is a pretty abstract thing, so it might help if we start with an analogy that should be pretty familiar to most of you. The analogy is a shipping container in the transportation industry. Throughout history, people have been transporting goods from one location to another by various means. Before the invention of the wheel, goods would most probably have been transported in bags, baskets, or chests on the shoulders of the humans themselves, or they might have used animals such as donkeys, camels, or elephants to transport them.

With the invention of the wheel, transportation became a bit more efficient as humans built roads that they could move their carts along. Many more goods could be transported at a time. When the first steam-driven machines, and later gasoline-driven engines, were introduced...

Why are containers important?

These days, the time between new releases of an application become shorter and shorter, yet the software itself doesn't become any simpler. On the contrary, software projects increase in complexity. Thus, we need a way to tame the beast and simplify the software supply chain.

Also, every day, we hear that cyber-attacks are on the rise. Many well-known companies are and have been affected by security breaches. Highly sensitive customer data gets stolen during such events, such as social security numbers, credit card information, and more. But not only customer data is compromised  sensitive company secrets are stolen too.

Containers can help in many ways. First of all, Gartner found that applications running in a container are more secure than their counterparts not running in a container. Containers...

What's the benefit for me or for my company?

Somebody once said that, today, every company of a certain size has to acknowledge that they need to be a software company. In this sense, a modern bank is a software company that happens to specialize in the business of finance. Software runs all businesses, period. As every company becomes a software company, there is a need to establish a software supply chain. For the company to remain competitive, their software supply chain has to be secure and efficient. Efficiency can be achieved through thorough automation and standardization. But in all three areas  security, automation, and standardization  containers have been shown to shine. Large and well-known enterprises have reported that, when containerizing existing legacy applications (many call them traditional...

The Moby project

Originally, when Docker (the company) introduced Docker containers, everything was open source. Docker didn't have any commercial products at this time. The Docker engine that the company developed was a monolithic piece of software. It contained many logical parts, such as the container runtime, a network library, a RESTful (REST) API, a command-line interface, and much more.

Other vendors or projects such as Red Hat or Kubernetes were using the Docker engine in their own products, but most of the time, they were only using part of its functionality. For example, Kubernetes did not use the Docker network library for the Docker engine but provided its own way of networking. Red Hat, in turn, did not update the Docker engine frequently and preferred to apply unofficial patches to older versions of the Docker engine,...

Docker products

Docker currently separates its product lines into two segments. There is the Community Edition (CE), which is closed-source yet completely free, and then there is the Enterprise Edition (EE), which is also closed-source and needs to be licensed on a yearly basis. These enterprise products are backed by 24/7 support and are supported by bug fixes.

Docker CE

Part of the Docker Community Edition are products such as the Docker Toolbox and Docker for Desktop with its editions for Mac and Windows. All these products are mainly targeted at developers.

Docker for Desktop is an easy-to-install desktop application that can be used to build, debug, and test Dockerized applications or services on a...

Container architecture

Now, let's discuss how a system that can run Docker containers is designed at a high level. The following diagram illustrates what a computer that Docker has been installed on looks like. Note that a computer that has Docker installed on it is often called a Docker host because it can run or host Docker containers:

High-level architecture diagram of the Docker engine

In the preceding diagram, we can see three essential parts:

  • On the bottom, we have the Linux operating system
  • In the middle, in dark gray, we have the container runtime
  • On the top, we have the Docker engine

Containers are only possible due to the fact that the Linux OS provides some primitives, such as namespaces, control groups, layer capabilities, and more, all of which are leveraged in a very specific way by the container runtime and the Docker engine. Linux kernel...

Summary

In this chapter, we looked at how containers can massively reduce friction in the software supply chain and, on top of that, make the supply chain much more secure.

In the next chapter, we will learn how to prepare our personal or working environment such as that we can work efficiently and effectively with Docker. So, stay tuned.

Questions

Please answer the following questions to assess your learning progress:

  1. Which statements are correct (multiple answers are possible)?

A. A container is kind of a lightweight VM
B. A container only runs on a Linux host
C. A container can only run one process
D. The main process in a container always has PID 1
E. A container is one or more processes encapsulated by Linux namespaces and restricted by cgroups

  1. In your own words, maybe by using analogies, explain what a container is.
  2. Why are containers considered to be a game-changer in IT? Name three or four reasons.
  3. What does it mean when we claim: If a container runs on a given platform, then it runs anywhere...? Name two to three reasons why this is true.
  4. Docker containers are only really useful for modern greenfield applications based on microservices. Please justify your answer.

A. True
B...

Further reading

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Grasp basic to advanced Docker concepts with this comprehensive guide
  • Get acquainted with Docker containers, Docker images, orchestrators, cloud integration, and networking
  • Learn to simplify dependencies and deploy and test containers in production

Description

Containers enable you to package an application with all the components it needs, such as libraries and other dependencies, and ship it as one package. Docker containers have revolutionized the software supply chain in both small and large enterprises. Starting with an introduction to Docker fundamentals and setting up an environment to work with it, you’ll delve into concepts such as Docker containers, Docker images, and Docker Compose. As you progress, the book will help you explore deployment, orchestration, networking, and security. Finally, you’ll get to grips with Docker functionalities on public clouds such as Amazon Web Services (AWS), Azure, and Google Cloud Platform (GCP), and learn about Docker Enterprise Edition features. Additionally, you’ll also discover the benefits of increased security with the use of containers. By the end of this Docker book, you’ll be able to build, ship, and run a containerized, highly distributed application on Docker Swarm or Kubernetes, running on-premises or in the cloud.

Who is this book for?

This book is for Linux professionals, system administrators, operations engineers, DevOps engineers, and developers or stakeholders who are interested in getting started with Docker from scratch. No prior experience with Docker containers is required. Users with a Linux system would be able to take full advantage of this book.

What you will learn

  • Containerize your traditional or microservice-based applications
  • Develop, modify, debug, and test an application running inside a container
  • Share or ship your application as an immutable container image
  • Build a Docker Swarm and a Kubernetes cluster in the cloud
  • Run a highly distributed application using Docker Swarm or Kubernetes
  • Update or rollback a distributed application with zero downtime
  • Secure your applications with encapsulation, networks, and secrets
  • Troubleshoot a containerized, highly distributed application in the cloud

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 13, 2020
Length: 592 pages
Edition : 2nd
Language : English
ISBN-13 : 9781838827472
Vendor :
Docker
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Mar 13, 2020
Length: 592 pages
Edition : 2nd
Language : English
ISBN-13 : 9781838827472
Vendor :
Docker
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
R$50 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
R$500 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just R$25 each
Feature tick icon Exclusive print discounts
R$800 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just R$25 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total R$ 737.97
Docker for Developers
R$245.99
Mastering Docker, Fourth Edition
R$245.99
Learn Docker - Fundamentals of Docker 19.x
R$245.99
Total R$ 737.97 Stars icon
Banner background image

Table of Contents

24 Chapters
Section 1: Motivation and Getting Started Chevron down icon Chevron up icon
What Are Containers and Why Should I Use Them? Chevron down icon Chevron up icon
Setting Up a Working Environment Chevron down icon Chevron up icon
Section 2: Containerization, from Beginner to Black Belt Chevron down icon Chevron up icon
Mastering Containers Chevron down icon Chevron up icon
Creating and Managing Container Images Chevron down icon Chevron up icon
Data Volumes and Configuration Chevron down icon Chevron up icon
Debugging Code Running in Containers Chevron down icon Chevron up icon
Using Docker to Supercharge Automation Chevron down icon Chevron up icon
Advanced Docker Usage Scenarios Chevron down icon Chevron up icon
Section 3: Orchestration Fundamentals and Docker Swarm Chevron down icon Chevron up icon
Distributed Application Architecture Chevron down icon Chevron up icon
Single-Host Networking Chevron down icon Chevron up icon
Docker Compose Chevron down icon Chevron up icon
Orchestrators Chevron down icon Chevron up icon
Introduction to Docker Swarm Chevron down icon Chevron up icon
Zero-Downtime Deployments and Secrets Chevron down icon Chevron up icon
Section 4: Docker, Kubernetes, and the Cloud Chevron down icon Chevron up icon
Introduction to Kubernetes Chevron down icon Chevron up icon
Deploying, Updating, and Securing an Application with Kubernetes Chevron down icon Chevron up icon
Monitoring and Troubleshooting an App Running in Production Chevron down icon Chevron up icon
Running a Containerized App in the Cloud Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8
(6 Ratings)
5 star 50%
4 star 0%
3 star 33.3%
2 star 16.7%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




livernyc Jan 01, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I really enjoyed this book. It takes a liner path through docker and best practices to orchestrators. The book lets you follow along with examples. I only have a solid Microsoft background and intermediate Linux skills and I was able to follow along pretty much. This is a great book to help you wrap your mind around Docker containers and orchestrators. I'm no expert with these technologies but I definitely recommend this book if you have limited exposure to containers and docker and how they tie into orchestrators.
Amazon Verified review Amazon
Matthew Emerick Jul 14, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
About This BookThis book gives the reader a complete view of Docker, why you should use it, how to use it, and how to use it well. It gives the reader best practices from the beginning, no matter if they are using Windows, Linux, or a Mac. It starts from explaining what containers are, how to set them up, and then goes into tremendous detail on how to use them to the best advantage.Please keep in mind that this book was primarily written with Linux in mind, not Windows. There can be issues if working through this book using Windows. While you can work out how to make it work on your own, it can be very frustrating and ruin your enjoyment of the book. Packt offers a more Windows oriented book on Docker that may be a better match for you. This issue is mentioned on page 34, though would probably have been better placed in the preface to warn the reader before purchase.Who is This For?The author is taking a broad approach by making this for anyone who has no knowledge of Docker but needs to work with the technology. It is a straight forward reference and tutorial that intends to be suited for any beginner or intermediate Docker user.Why Was This Written?Technology is moving at a very fast pace and will continue to for years to come. Containerization is a fairly new, but extremely powerful, technique that is very popular and almost a necessity when entering the workforce as a software developer or architect. This book has every typically use case of Docker covered from installation to automation, making it easier to use than the official documentation.OrganizationThe book is organized into four sections. The first, and shortest, discusses why containers exist, why you should use them, and how to set up your system to use them. Then the book moves on to creating and using individual containers from the initial setup to automating them. Next, the book looks at how containers can work together. Finally, the author details how to use Kubernetes and the cloud with Docker to round out your understanding.Most chapters have a similar structure. They begin with the technical requirements to work through that chapter before moving on to the learning. The chapter finishes with a summary what was discussed, questions to help with your recall of the information, and links to other resources that will let you dig deeper into the chapter's topic.Did This Book Succeed?This book can easily take the place of the official documentation. Looking through the book, I went from having no knowledge of Docker to being competent. After building up some experience with my own projects, I will feel confident enough to work with it professionally.Rating and Final ThoughtsThis is an excellent book for anyone who needs to learn and use Docker. It definitely hits what it's aiming for, with only a few minor issues. I give it a 4.7 out of 5. If you need to learn Docker, this is probably the book for you.
Amazon Verified review Amazon
A R Jul 01, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have struggled with understanding Docker and containerization for a couple years. Mainly due to not using them all the time.Invested time into tutorials and videos, but that did not really cement anything for me.However, reading this book cover to cover and coming back to try some of the practical examples has really worked for me.Well written, gradually building up to slightly more complex scenarios.Technical books have always been a struggle to read through completely for me, yet this book for some reason kept me engaged.Well worth it, examples cover some Python, NodeJS, Java and C#.
Amazon Verified review Amazon
treesa Jun 18, 2020
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Unable to get the exercises to work on my windows machine. So much research to stitch together workarounds. Stopped at ch06.Resumed to absorb the conceptual knowledge and the chapters are networking and orchestration are quite good.
Amazon Verified review Amazon
Just Some Guy Nov 29, 2021
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Here's the TL;DR: This book is good, but it's not great. The tutorials are very good, but you should read other Docker books first to learn the fundamentals, then others again later for reference and depth.The Good:The books is at its best during the numerous step-by-step tutorials, which include ample code and screenshots for reference. The author starts with basic examples, and progresses to increasingly complex topics throughout the book. He does assume a fairly strong foundation in Linux/bash and networking (fair warning), but nothing too extreme for a search engine to answer if pressed.The Bad:This book is in no way a comprehensive education in Docker or Kubernetes. Beyond the specific tasks that the tutorials walk the reader through it does a poor job of explaining (in any real depth) the inner working of Docker/Kubernetes, and/or the wide range of APIs, commands, parameters, configurations, use cases, etc. that each support.No book can cover everything, of course - but I'm really glad I read a few other books on both topics before reading this, as I generally knew all the fundamentals going in (this book then helped me to gain some more hand-on experience, and taught me some great Docker dev techniques and tricks). I'd recommend anyone who wants to *really* learn these technologies start elsewhere first. This book just doesn't go deep outside of the narrow tactical goals which comprise the tutorial content.I should also note that while there are several chapters focused on Kubernetes, it is such a massive topic that this book only offers a very shallow introduction. It's not bad, but again you should start elsewhere to learn the tech, then read this for some nice intro k8s tutorials.The Ugly:This is probably just a personal peeve, but I just can't stand Schenker's writing style. He's just ... not very a very good writer. He writes at a high-school level in both vocabulary and style (the numerous run-on sentences in particular got on my nerves). Furthermore, the 'voice' he uses is far too casual and familiar for my taste (we're not pals talking tech over lunch - I'm paying you to teach me something of value. Act like it, please.). Like, if you have a point to make, don't ask a rhetorical question pretending to be your reader - this isn't a casual conversation. Write like an adult, make your case, and make your point. Thanks.If he matched the loose and sloppy writing with serious depth and value, I'd let it slide - but outside of the tutorials (which _are_ numerous, extensive, and (again) very good), his writing has too much fluff and personality, for too little value (i.e. poor signal/noise ratio).Final word - Read a few other books first, then read this for the Docker tutorials and a decent introduction to Kubernetes.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.