Skip to content

Docker: Compose: more commands

9 Docker commands: Compose: more commands. Click a command to see what each part does.

Index
9 items
Click a command to see what each part does.

Compose: more commands9

  • docker compose ps -aStatus of the stack's containers

    What each part does

    1. docker compose pscontainers of this project: service, state, health, ports
    2. -ainclude stopped ones
  • docker compose restart <service>; docker compose stop <service>Restart / stop one service

    What each part does

    1. restart <service>restart the container (config changes need up -d instead)
    2. stop <service>stop without removing
  • docker compose build --pull <service> && docker compose up -d <service>Rebuild images and recreate

    What each part does

    1. build --pullrebuild, pulling newer base images
    2. up -d <service>recreate the container with the new image
  • docker compose pullPull newer images for all services

    What each part does

    1. docker compose pulldownload the image of every service; follow with up -d to use them
  • docker compose up -d --scale <service>=3Run several replicas of a service

    What each part does

    1. --scale <service>=3run 3 containers of the service (don't fix a host port or container_name)
  • docker compose --profile <profile> up -dStart optional services with a profile

    What each part does

    1. --profile <profile>also start services marked profiles: [<profile>], e.g. debug or tools
  • docker compose watchRebuild automatically when files change

    What each part does

    1. docker compose watchsync or rebuild services on file changes, per the develop.watch section
  • docker compose top; docker compose imagesProcesses and images of the stack

    What each part does

    1. docker compose topprocesses in each service container
    2. docker compose imagesimage and tag each container uses
  • docker compose cp <service>:<path> ./Copy a file out of a service

    What each part does

    1. docker compose cplike docker cp, by service name

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…