From 27b1722d63ae9d57133f34dea37918c77e536917 Mon Sep 17 00:00:00 2001 From: Ilyes512 Date: Wed, 16 Sep 2026 21:47:42 +0200 Subject: [PATCH 1/2] build(taskfile): remove the volume-init container after every compose run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `docker compose run --rm` removes the container it was asked to run and nothing else. Every service that writes to the cache volume pulls in volume-init through depends_on to get the directories created and chowned, so each task left a completed specs-cli-volume-init-1 behind — harmless, but it accumulates one stale container per project that only ever surfaces in `docker ps -a`. The internal dc task is the single point every compose invocation passes through, so one defer there covers dc:run:*, dc:build, dc:shell and the lint, docs, markdown and demo taskfiles that call into it. Task runs deferred commands when the task ends regardless of its result, so a failing test tears the container down too. The teardown is the same defer the demo:record task already uses for the socket proxy. --- .github/instructions/executing-commands.md | 4 ++++ Taskfile.dist.yml | 1 + 2 files changed, 5 insertions(+) diff --git a/.github/instructions/executing-commands.md b/.github/instructions/executing-commands.md index 244c015..ab21272 100644 --- a/.github/instructions/executing-commands.md +++ b/.github/instructions/executing-commands.md @@ -39,6 +39,10 @@ produces now. Never run it to make a red test green without reading the diff fir service is a one-off container (`--rm`) under the `build` profile — it does not need to be started before use. +Every task routed through `docker compose` removes the `volume-init` container it pulled in +through `depends_on` when it finishes, so a run leaves no stopped containers behind. The +teardown is visible in the output; it is not an error. + `task demo:record:` re-records `docs/demo/.tape` into `docs/static/demo/.gif` inside the `vhs` Docker Compose service under the `demo` profile. It needs network access and the Docker socket, and it always dirties the working tree — the same tape never produces diff --git a/Taskfile.dist.yml b/Taskfile.dist.yml index 2c3d266..36449be 100644 --- a/Taskfile.dist.yml +++ b/Taskfile.dist.yml @@ -25,6 +25,7 @@ tasks: FIXGID: sh: echo ${FIXGID:-$(id -g)} cmds: + - defer: docker compose rm --stop --force volume-init - FIXUID={{ .FIXUID }} FIXGID={{ .FIXGID }} docker compose {{ .SUB_CMD }} {{ .CLI_ARGS }} dc:build: From 8b5d7b2b6d13917f0fa9d5a423a03ecbf631b0f5 Mon Sep 17 00:00:00 2001 From: Ilyes512 Date: Wed, 16 Sep 2026 21:47:51 +0200 Subject: [PATCH 2/2] build(taskfile): take the project's containers down in cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cleanup task promised "gitignored files, untracked files and development containers" and delivered a `git clean` — a hugo or docs-preview service started from this project survived a cleanup untouched. `docker compose --profile "*" down --remove-orphans` runs first, across every profile, so the promise holds. Deliberately without `--volumes`: the cache volume holds the Go build, module and golangci-lint caches, and throwing those away would turn a workspace cleanup into a multi-minute rebuild. --- .github/instructions/executing-commands.md | 3 ++- Taskfile.dist.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/instructions/executing-commands.md b/.github/instructions/executing-commands.md index ab21272..77b778a 100644 --- a/.github/instructions/executing-commands.md +++ b/.github/instructions/executing-commands.md @@ -41,7 +41,8 @@ started before use. Every task routed through `docker compose` removes the `volume-init` container it pulled in through `depends_on` when it finishes, so a run leaves no stopped containers behind. The -teardown is visible in the output; it is not an error. +teardown is visible in the output; it is not an error. `task cleanup` takes down whatever is +left of the project — containers and networks, but not the `cache` volume. `task demo:record:` re-records `docs/demo/.tape` into `docs/static/demo/.gif` inside the `vhs` Docker Compose service under the `demo` profile. It needs network access and diff --git a/Taskfile.dist.yml b/Taskfile.dist.yml index 36449be..3bacdac 100644 --- a/Taskfile.dist.yml +++ b/Taskfile.dist.yml @@ -111,6 +111,7 @@ tasks: The following files/dirs are excluded: none cmds: + - docker compose --profile "*" down --remove-orphans - git clean -xd --force