Compose file reference

Ask Gordon

Copy Markdown

View Markdown



New to Docker Compose?

Find more information about the key features and use cases of Docker Compose or try the quickstart guide.

The Compose Specification is the latest and recommended version of the Compose file format. It helps you define a Compose file which is used to configure your Docker application’s services, networks, volumes, and more.

Legacy versions 2.x and 3.x of the Compose file format were merged into the Compose Specification. It is implemented in versions 1.27.0 and above (also known as Compose v2) of the Docker Compose CLI.

The Compose Specification on Docker Docs is the Docker Compose implementation. If you wish to implement your own version of the Compose Specification, see the Compose Specification repository.

Use the following links to navigate key sections of the Compose Specification.

Tip

Want a better editing experience for Compose files in VS Code? Check out the Docker DX extension for linting, code navigation, and vulnerability scanning.

[### Version and name top-level element

Understand version and name attributes for Compose.](https://docs.docker.com/reference/compose-file/version-and-name/)

[### Services top-level element

Explore all services attributes for Compose.](https://docs.docker.com/reference/compose-file/services/)

[### Networks top-level element

Find all networks attributes for Compose.](https://docs.docker.com/reference/compose-file/networks/)

[### Volumes top-level element

Explore all volumes attributes for Compose.](https://docs.docker.com/reference/compose-file/volumes/)

[### Configs top-level element

Find out about configs in Compose.](https://docs.docker.com/reference/compose-file/configs/)

[### Secrets top-level element

Learn about secrets in Compose.](https://docs.docker.com/reference/compose-file/secrets/)

Edit this page

Request changes