Difference between revisions of "Docker-compose"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 43: Line 43:
 
* <code>[[docker-compose images]]</code>
 
* <code>[[docker-compose images]]</code>
 
* <code>docker-compose kill</code>
 
* <code>docker-compose kill</code>
* <code>docker-compose logs</code><ref>https://docs.docker.com/compose/reference/logs/</ref>: <code>docker-compose logs SERVICE_NAME</code> (You will find your SERVICE_NAME looking into your docker-compose.yml file)
+
* <code>[[docker-compose logs]]</code><ref>https://docs.docker.com/compose/reference/logs/</ref>: <code>docker-compose logs SERVICE_NAME</code> (You will find your SERVICE_NAME looking into your docker-compose.yml file)
 
* <code>docker-compose pause</code>
 
* <code>docker-compose pause</code>
 
* <code>docker-compose port</code>
 
* <code>docker-compose port</code>

Revision as of 12:11, 27 January 2020

Docker Compose[1] is a tool available since October 2014 for defining and running multi-container Docker applications.

Rules are defined in docker-compose.yml and executed by running docker-compose up command.

docker-compose allows to define start order dependencies between containers.

For reference of valid options for docker compose check: https://docs.docker.com/compose/compose-file/

Installation

  • brew install docker-compose

Basic commands

  • docker-compose -h (for list of commands and options)
  • docker-compose —-log-level
docker-compose up -d
-d daemon
docker-compose -f docker-compose_YOUR_NAME.yml up -d
  • Start your containers with a command line variable:
YOUR_VARIABLE=YOUR_VALUE docker-compose up[3]
  • docker-compose -p NAME --project-name

Logs:

All commands

docker-compose[4]

docker-compose down --remove-orphans

Docker compose file: docker-compose.yml

Activities

Basic

  1. Read docker-compose StackOverflow questions: https://stackoverflow.com/questions/tagged/docker-compose?tab=Votes
  2. Read docker-compose changelog: https://github.com/docker/compose/blob/master/CHANGELOG.md
  3. Review docker compose file format evolution

Advanced

  1. Read docker-compose source code: https://github.com/docker/compose
  2. Read Ansible module documentation about docker_compose: https://docs.ansible.com/ansible/latest/modules/docker_compose_module.html
  3. Learn to use extension-fields[8] or templating added in 3.4 version. [9]

See also


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.

Source: https://en.wikiversity.org/wiki/DevOps/Docker/docker_compose

Advertising: