
The short syntax variant only specifies the config name. Of this stack file, or stack deployment fails.įor more information on configs, see configs. Note: The config must already exist or beĭefined in the top-level configs configuration

Two different syntax variants are supported. Grant access to configs on a per-service basis using the per-service configsĬonfiguration. This section contains a list of all configuration options supported by a serviceĬonfiguration options that are applied at build time.īuild can be specified either as a string containing a path to the buildĬommand : configs You can use environment variables in configuration values with a Bash-like Specify them again in docker-compose.yml. Likewise, network and volume definitions are analogous toĭocker network create and docker volume create.Īs with docker run, options specified in the Dockerfile, such as CMD,ĮXPOSE, VOLUME, ENV, are respected by default - you don’t need to yaml extension for this file.Ī service definition contains configuration that is applied to eachĬontainer started for that service, much like passing command-line parameters toĭocker run. This maps to the : : indent structure of theĬompose file. Networks, and so on, are listed with the options that support them as Top-level keys that defineĪ section in the configuration file such as build, deploy, depends_on, To reflect the structure of the Compose file itself. The topics on this reference page are organized alphabetically by top-level key "/var/run/docker.sock:/var/run/docker.sock" Image: dockersamples/examplevotingapp_worker Image: dockersamples/examplevotingapp_result:before Image: dockersamples/examplevotingapp_vote:before Here is a sample Compose file from the voting app sample used in the

The latest Compose file format is defined by the Compose Specification and is implemented by Docker Compose 1.27.0+. For example, Compose file formatģ.0 was first introduced in Compose release Itself is on a release schedule, as shown in Composeĭo not necessarily increment with each release. In addition to Compose file format versions shown in the table, the Compose This table shows which Compose file versions support specific Docker releases.

How to upgrade, see About versions and upgrading. For full details on what each version includes and There are several versions of the Compose file format – 1, 2, 2.x, and 3.x. These topics describe version 3 of the Compose file format. For more information, see the Evolution of Compose. Make sure you switch to Compose V2 with the docker compose CLI plugin or by activating the Use Docker Compose V2 setting in Docker Desktop. From the end of June 2023 Compose V1 won’t be supported anymore and will be removed from all Docker Desktop versions.
