Docker compose file: docker-compose.yml

From wikieduonline
(Redirected from Docker-compose.yml)
Jump to navigation Jump to search

Review different versions of docker-compose.yml


docker-compose.yml examples[edit]

YAML Explained[edit]

Version and at least one service is needed.

volumes: [2]
config: [3]
networks: [5]

 version: "3.9" Informative/deprecated

Version 3[edit]

Removed options: volume_driver, volumes_from, cpu_shares, cpu_quota, cpuset, mem_limit, memswap_limit, extends, group_add


  • max_replicas_per_node in placement configurations

v3.7 (18.06.0+) (2018-07-17)[6]

  • init in service definitions
  • rollback_config in deploy configurations
  • Support for extension fields at the root of service, network, volume, secret and config definitions

v3.6 (8.02.0+)

  • tmpfs size for tmpfs-type mounts


  • isolation in service definitions
  • name for networks, secrets and configs
  • shm_size in build configurations


  • CACHE_FROM added

v3.1 (2017-02-08)[7]

Restart policy[edit]

restart: "no"         (default)
restart: always
restart: on-failure
restart: unless-stopped
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 120s
  • Version 2:
- restart: no|always|on-failure</code><ref></ref>


driver: none|local|json-file|syslog|journald|gelf|fluentd|awslogs|splunk|etwlogs|gcplogs|logentries
json-file is the default option

See also: docker logs: docker logs --since 1h CONTAINER_NAME

Related terms[edit]

See also[edit]

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Original Source: