Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Learn Docker - Fundamentals of Docker 18.x

You're reading from   Learn Docker - Fundamentals of Docker 18.x Everything you need to know about containerizing your applications and running them in production

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788997027
Length 398 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Dr. Gabriel N. Schenker Dr. Gabriel N. Schenker
Author Profile Icon Dr. Gabriel N. Schenker
Dr. Gabriel N. Schenker
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Title Page
Packt Upsell
Contributors
Preface
1. What Are Containers and Why Should I Use Them? 2. Setting up a Working Environment FREE CHAPTER 3. Working with Containers 4. Creating and Managing Container Images 5. Data Volumes and System Management 6. Distributed Application Architecture 7. Single-Host Networking 8. Docker Compose 9. Orchestrators 10. Introduction to Docker Swarm 11. Zero Downtime Deployments and Secrets 12. Introduction to Kubernetes 13. Deploying, Updating, and Securing an Application with Kubernetes 14. Running a Containerized App in the Cloud 1. Assessment 2. Other Books You May Enjoy Index

Chapter 11


  1. Zero downtime means that when updating a service, say from version 1 to version 2, the application to which this service belongs remains up and running all the time. At no time is the application interrupted or not functional.
  2. Docker SwarmKit uses rolling updates to achieve zero downtime. Every service runs in multiple instances for high availability. When a rolling update is happening, small batches of the overall set of service instances are replaced by new versions. This happens while the majority of the service instances are up and running to serve incoming requests.
  3. Container images are immutable. That is, once created, they can never be changed. When a containerized application or service needs to be updated, a new container image is created. During a rolling update, the old container image is replaced with the new container image. If a rollback is necessary, then the new image is replaced with the old image. This can be looked at as a reverse update. As long as we do not delete the old container image, we can always return to this previous version by reusing it. Since, as we said earlier, images are immutable, we are indeed returning to the previous state.
  4. Docker secrets are encrypted at rest; they are stored encrypted in the raft database. Secrets are also encrypted in transit since the node-to-node communication is using mutual TLS.
  5. The command would have to look like this:
$ docker service update --image acme/inventory:2.1 \
    --update-parallelism 2 \
    --update-delay 60s \
    inventory
  1. First, we need to remove the old secret:
$ docker service update --secret-rm MYSQL_PASSWORD inventory

Then we add the new secret and make sure we use the extended format where we can remap the name of the secret, that is, the external and internal name of the secret do not have to match. The latter command could look like this:

$ docker service update \
    --secret-add source=MYSQL_PASSWORD_V2,target=MYSQL_PASSWORD \
    inventory
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images