Scale a compose service

Run 5 replicas of the worker service

docker compose up -d --scale worker=5

tool
docker46 commands
tags
docker

More docker commands

  • docker compose logs -f --tail=100 worker

    Stream last 100 lines of a specific compose service

  • docker network inspect bridge | jq '.[0].Containers | to_entries[] | .value | {Name, IPv4Address}'

    Show IPs of all containers in the bridge network

  • docker network create --driver bridge --subnet 172.30.0.0/24 mynet

    Create a bridge network with a custom subnet

  • docker save myapp:1.0 | gzip > myapp.tar.gz && docker load < myapp.tar.gz

    Export image to archive and reimport on another host

  • HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD curl -sf http://localhost:8080/health || exit 1

    Native Docker healthcheck with curl (add to Dockerfile)

all 46 docker commands