Docker Compose in Depth
Docker has taken the development world by storm in recent years, being the first effective tool that wraps up a piece of software in a complete file system package, installs it on a server, and runs it repeatedly. However, until recently it was difficult to do this with micro-architectures composed of numerous containers that all need to work in conjunction with one another. Enter Docker Compose, the handiest tool to hit the tech world since Docker. Here’s everything you need to know…
Learn Docker Compose Inside Out
- Define multi-container application environments
- Create flexible, customisable environments and networks
- Transform an existing application into a fully Docker-ised environment
- Enhance your Docker experience
Make Your Docker Experience Even More Stress-Free
This Docker Compose online course will make you a DC expert, learning the tool from top to bottom. It has been specifically designed for those that already know Docker, so you’ll skip the baby steps and dive straight in. First you’ll cover the basic features using a sample environment, gaining an understanding of restarts, dependencies, and persisting the database with a volume.
After that you’ll progress to networks. You’ll take an in-depth look at isolating containers, aliases and container names, links, using external networks, and how updates affect networking. Then it’s on to the really good stuff; a section each is dedicated to volumes, logging, the Compose CLI, and ‘Composing Compose’ (don’t worry, it won’t be as complicated as it sounds by the time you get there). Finally you’ll learn about Compose in Production.
The course is organised into logical sections so you can progress at your pace and in your own time. By the end, you’ll apply what you’ve learned to create a large environment for a sample legacy system, using all of the features covered in previous sections. You’ll then have the skills and confidence needed to go forth and create your own flexible application environments with Docker Compose.
About Docker Compose
Docker Compose is a useful tool from the people at Docker. It makes defining and running application environments made up of multiple Docker containers even easier and more efficient. Up until now, starting any more than one or two Docker containers was extremely complicated. With Docker Compose, the entire process just got infinitely better.
Download files here
Through exposition and judicious use of slides, we’ll talk about what Compose is, what you could use it for, and what kinds of features it has (without getting into the nitty-gritty).
In this lecture you'll install and verify you have Compose available on your system.
In this lecture, we’ll get Compose installed on your machine and learn the fundamentals of the ‘docker-compose’ command-line interface and accompanying ‘docker-compose.yml’ file driving it.
This lecture introduces the sample Wordpress environment we will be reproducing in the section.
In this lecture, we'll take a look at existing approaches for integrating the "wordpress" container.
In this lecture, we'll update the "version 1" service configuration to the Compose version 2 format, and learn about some of the caveats of version 1 vs 2.
In this lecture, we'll make our non-persistent "db" service persistent through the use of volumes. We'll also experiment with ways our containers may look persistent, but ultimately bite us.
In this lecture, we'll learn about how Compose's restart policies and dependency configurations affect containers.
In this lecture, we'll add a dependency to our Compose environment and finalize our "db" service. We'll illustrate how new changes to the service allow us to achieve persistence.
This lecture introduces Docker Networks in Compose. You'll hear about a few of the capabilities and features provided before jumping in the the subsequent lectures.
In this lecture, you'll learn about Compose's default network, how it behaves, and how you can change the name or behavior of the network.
This lecture explores the ability to isolate containers using multiple networks. You'll learn how to add containers to a network, isolate containers from one another and a few handy shortcuts for diagnosing network reachability.
This lecture will explore the 'alias' and 'container_name' service configurations and how they affect scalability and reachability of containers.
In this lecture, we'll explore how Docker "links" work in Compose. While they're not suggested, you'll learn how they behave and why you may want to avoid them in Compose.
This explanatory lecture will explore how updates to a Compose environment affect existing network connections.
Rounding out the section, we'll learn how you can make use of existing external networks from a Compose environment. You'll also learn how to further configure Compose networks to fit into your own specialized environments.
This lecture will introduce using Docker Volume's in Compose and how they can be used.
This lecture will explore how to add a simple volume to a service.
This lecture explores more specialized volumes. In particular, you'll learn how to create named volumes and share them between containers.
In this lecture you will learn about advanced Volume configuration, including external volumes and the plethora of Volume plugins available in Compose.
This lecture will teach you how to configure logging drivers for containers in your Compose environment
This lecture will show you how to forward logs from your Compose environment to a remote Syslog service (in this case, Paperclip).
The Compose CLI
This lecture will give you an overview of command-line arguments and environment variables you can use to influence how your Compose environment runs. You'll learn how to source environments from other files with "--file", change the name of your environment, and set Docker host options.
This lecture will explore the ins and outs of Compose's "up" lifecycle and how you can modify its behavior or run sections of the lifecycle independently.
This lecture will teach you a few commands you can use to interact with the shape of a running environment. You'll learn to change the number of running services with 'scale', halt services with 'pause' & 'unpause', and run one-off "administrative" jobs with 'run'.
This lecture will explore Compose's "informational" commands: 'port', 'ps', 'logs' and 'events'.
This lecture will explore the ins and outs of Compose's "down" lifecycle and how you can modify its behavior or run sections of the lifecycle independently. You'll also learn how to restart containers with the 'restart' command.
This lecture will explore "environment files" in Compose, and how you can use them to provide default or non-default variables for consumption in your Compose YAML files.
This lecture will dive deep on the "--file" parameter of the Compose CLI. You'll learn the usage and behavior for merging multiple environments or environment snippets into a single Compose environment.
This lecture will introduce the default "override" file Compose reads from, what you can use it for, and how to exclude it from your Compose environment.
This lecture will show you how to use the 'extends' service configuration to build a new service based off a "base" service in another file.
This lecture will explore how you can use Compose's 'run' command along with additional Compose files to run administrative tasks not normally a part of your default environment.
Compose in Production
This lecture will introduce a "production" like sample environment—based on the example from the Compose Basics section—and how it enacts a few best practices.
This lecture will explore the "provision" script provided in the example. You'll learn how to use it to create and interact with a Swarm environment on your local development machine, or on Digital Ocean.
This lecture will teach you how to deploy the a sample environment to your freshly minted Swarm Cluster using Compose environment variables.
This lecture will explore some of the deficiencies of the sample environment, and prompt the student to undertake one of many potential improvements on their own.