2017-08-31 09:55:23 +01:00
|
|
|
# docker-compose
|
|
|
|
|
|
|
|
> Run and manage multi container docker applications.
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <https://docs.docker.com/compose/reference/overview/>.
|
2017-08-31 09:55:23 +01:00
|
|
|
|
2019-10-30 12:59:17 +00:00
|
|
|
- List all running containers:
|
|
|
|
|
|
|
|
`docker-compose ps`
|
|
|
|
|
2017-08-31 09:55:23 +01:00
|
|
|
- Create and start all containers in the background using a `docker-compose.yml` file from the current directory:
|
|
|
|
|
|
|
|
`docker-compose up -d`
|
|
|
|
|
|
|
|
- Start all containers, rebuild if necessary:
|
|
|
|
|
|
|
|
`docker-compose up --build`
|
|
|
|
|
|
|
|
- Start all containers using an alternate compose file:
|
|
|
|
|
|
|
|
`docker-compose --file {{path/to/file}} up`
|
|
|
|
|
|
|
|
- Stop all running containers:
|
|
|
|
|
|
|
|
`docker-compose stop`
|
|
|
|
|
|
|
|
- Stop and remove all containers, networks, images, and volumes:
|
|
|
|
|
2019-11-05 01:16:46 +00:00
|
|
|
`docker-compose down --rmi all --volumes`
|
2017-08-31 09:55:23 +01:00
|
|
|
|
|
|
|
- Follow logs for all containers:
|
|
|
|
|
|
|
|
`docker-compose logs --follow`
|
2020-10-24 13:59:15 +01:00
|
|
|
|
|
|
|
- Follow logs for a specific container:
|
|
|
|
|
|
|
|
`docker-compose logs --follow {{container_name}}`
|