Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Docker, Fourth Edition

You're reading from   Mastering Docker, Fourth Edition Enhance your containerization and DevOps skills to deliver production-ready applications

Arrow left icon
Product type Paperback
Published in Oct 2020
Publisher Packt
ISBN-13 9781839216572
Length 568 pages
Edition 4th Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Russ McKendrick Russ McKendrick
Author Profile Icon Russ McKendrick
Russ McKendrick
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

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

Docker Swarm services and stacks

So far, we have looked at the following commands:

$ docker swarm <command>
$ docker node <command>

These two commands allow us to bootstrap and manage our Docker Swarm cluster from a collection of existing Docker hosts. The next two commands we are going to look at are as follows:

$ docker service <command>
$ docker stack <command>

The service and stack commands allow us to execute tasks that, in turn, launch, scale, and manage containers within our Swarm cluster.

Services

The service command is a way of launching containers that take advantage of the Swarm cluster. Let's look at launching a really basic single-container service on our Swarm cluster.

TIP

Don't forget that the docker commands here need to be executed from your current Swarm manager. If you are following, that should be node2.

To do this, run the following command:

$ docker service create \
    --name...
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 $19.99/month. Cancel anytime