0% found this document useful (0 votes)
50 views3 pages

Docker Compose Guide for Developers

This document serves as a reference for Docker Compose, specifically focusing on version 3 of the Compose file. It outlines core commands such as 'docker-compose up', 'docker-compose start', and 'docker-compose down', along with the structure of a Compose YML file. Additional resources and examples for creating and configuring Compose files are provided through links to the official Docker documentation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views3 pages

Docker Compose Guide for Developers

This document serves as a reference for Docker Compose, specifically focusing on version 3 of the Compose file. It outlines core commands such as 'docker-compose up', 'docker-compose start', and 'docker-compose down', along with the structure of a Compose YML file. Additional resources and examples for creating and configuring Compose files are provided through links to the official Docker documentation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Docker Compose Reference

Compose File Version 3 Cheat Sheet

Please remember to check your Docker version along with the file version if you run into any
issues. You can find more here:

https://docs.docker.com/compose/compose-file/compose-versioning/

The following commands can be found at ​https://docs.docker.com/compose/reference/

A list of core commands include the following:

Docker-compose up
#​Builds, (re)creates, starts, and attaches to containers for a service.

Docker-compose start
Starts existing containers for a service.

Docker-compose stop
#Stops running containers without removing them. They can be started again with ​docker-compose
start​.

Docker-compose ps
#This command will list containers

#Docker-compose down
#Stops containers and removes containers, networks, volumes, and images created by ​up​.
For a Compose file, we are building a YML or YAML (.yml or .yaml both work) to define our services,
networks, and volumes. The default path for a Compose file is ./docker-compose.yml.

Version 3 Example

For examples of version 3 please see:


https://docs.docker.com/compose/compose-file/#compose-file-structure-and-examples

Docker Compose File Reference: ​https://docs.docker.com/compose/


A compose YML file will look similar to the following as an example:

Compose File elements

Also, when building a compose file the following reference can be extremely helpful:

https://docs.docker.com/compose/compose-file/#expose

You can examine the parameters for specific builds, such as:

Secrets Configuration Reference


Networks

Restart Policy

You might also like