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

Exploring Docker Compose commands

We are over halfway through the chapter, and the only Docker Compose command we have run is docker-compose up. If you have been following along and you run docker container ls -a, you will see something similar to the following Terminal screen:

Figure 5.8 – Output for docker container ls -a

As you can see, we have a lot of containers with the status of Exited. This is because when we used Ctrl + C to return to our Terminal, the Docker Compose containers were stopped.

Choose one of the Docker Compose applications and change to the folder that contains the docker-compose.yml file, and we will work through some more Docker Compose commands. I will be using the Example Vote application.

up and ps

The first command is docker-compose up, but this time, we will be adding a flag. In your chosen application folder, run the following:

$ docker-compose up -d

This will start your application back up, this time in...

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 €18.99/month. Cancel anytime