Docker

Docker Compose

Create and start containers

docker-compose up

Create and start containers in detached mode

docker-compose up -d

Stop and remove containers, networks, images, and volumes

docker-compose down

View output from containers

docker-compose logs

Restart all services

docker-compose restart

Pull all images for services

docker-compose pull

Build all images for services

docker-compose build

Validate and view the Compose file

docker-compose config

Scale a service (set replicas)

docker-compose scale <service_name>=<replica>

Display the running processes

docker-compose top

Start a service, map a port, run a command, and remove the container

docker-compose run -rm -p 2022:22 web bash

On this page