Docker Compose Tip #79: docker compose run advanced flags

docker compose run creates a fresh container for a service and attaches your terminal to it. Compared to exec (Tip #34), which jumps into a running container, run is for one-shot tasks — migrations, ad-hoc scripts, REPLs, smoke tests. The flags around it decide what gets started, what gets cleaned up, and whether ports are published. –rm — clean up after exit By default, the container created by run stays around (stopped) after the command finishes. That accumulates dead containers fast in a dev loop. --rm removes the container as soon as it exits: ...

June 22, 2026 · 4 min · 684 words · Guillaume Lours

Docker Compose Tip #78: The COMPOSE_* environment variables

Almost every Compose CLI flag has an environment-variable counterpart. Setting them once in a project .env file, in your shell, or in CI removes the need to retype the same flags on every command — and makes the configuration of a stack visible to anything that reads the environment. The core set The variables you reach for most often: Variable What it sets CLI equivalent COMPOSE_FILE Path(s) to the Compose file(s) -f, --file COMPOSE_PATH_SEPARATOR Separator when listing multiple files (in COMPOSE_FILE) COMPOSE_PROJECT_NAME Project name -p, --project-name COMPOSE_PROFILES Profiles to enable --profile COMPOSE_ENV_FILES Project-level env files --env-file COMPOSE_PARALLEL_LIMIT Max parallel operations --parallel (on some subcommands) COMPOSE_IGNORE_ORPHANS Don’t warn about orphan containers (no flag) COMPOSE_REMOVE_ORPHANS Always remove orphans on up/down --remove-orphans COMPOSE_ANSI Control ANSI output (auto, never, always) --ansi COMPOSE_PROGRESS Progress style (auto, tty, plain, json, quiet) --progress COMPOSE_STATUS_STDOUT Send status messages to stdout instead of stderr (no flag) COMPOSE_MENU Disable the interactive Docker Desktop menu (no flag) The full list lives in the Compose docs. The table above covers the ones that show up in real workflows. ...

June 19, 2026 · 4 min · 702 words · Guillaume Lours

Docker Compose Tip #76: docker compose down and its options

docker compose down looks like a tidy shutdown command. It is, but the flags around it decide whether you walk away with your data intact, with a clean image store, or with a database wiped because you typed -v out of habit. The default behavior Without any flag, down stops and removes: Every container in the project The default network Compose created for the project Anonymous volumes that the stack was using It does not remove: ...

June 15, 2026 · 3 min · 606 words · Guillaume Lours

Docker Compose Tip #74: docker compose ls and cross-project visibility

docker compose ps shows the services inside the current project. docker compose ls zooms out: every Compose stack running anywhere on the host, regardless of which directory you happen to be standing in. The basics Run it from any directory: docker compose ls Sample output: NAME STATUS CONFIG FILES api-platform running(4) /home/dev/api-platform/compose.yaml data-pipeline running(2) /home/dev/data-pipeline/compose.yaml old-prototype exited(3) /tmp/prototype/compose.yaml Three columns: the project name, how many services are up, and the path to the Compose file that started it. No need to cd into the project to see what’s running. ...

June 10, 2026 · 3 min · 492 words · Guillaume Lours

Docker Compose Tip #68: Waiting for service exit with docker compose wait

docker compose up --wait (Tip #51) waits for services to become healthy. docker compose wait does something different: it waits for services to exit, and returns their exit code. Basic usage docker compose wait <service> The command blocks until the specified service stops, then prints the exit code. If you echo $? after, it’s the same value. This is perfect for one-shot services: migrations, batch jobs, test runners, anything that runs and exits. ...

May 27, 2026 · 2 min · 375 words · Guillaume Lours