You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mocker version: 0.7.2 (Homebrew) — macOS, Darwin 25.5.0, arm64
Summary
mocker rmi resolves image references only in their fully-qualified form. Consequences, worst first:
When a bare tag and a qualified tag share a name, rmi <name>:<tag>deletes the qualified image instead of the bare one and reports success — the wrong image is destroyed silently.
Short references such as busybox:1.37 — ordinary docker rmi usage — fail with No such image.
The backend supports all of these; the gap is in mocker's reference resolution.
Reproduction 1 — rmi deletes the wrong image
Starting state, two distinct images both named caddy:latest (the bare one produced by compose build per #73, the qualified one pulled from Docker Hub):
$ mocker images | grep -i caddycaddy latest sha256:4b9ba # mocker's builddocker.io/library/caddy latest sha256:844f6 # official base
The official base was deleted. The build survived. The output reads as success, and nothing indicates a different image was targeted than the one named.
Repeating the command now fails, since the only remaining caddy:latest is the bare-name build:
$ mocker rmi caddy:latestError: Error response from daemon: No such image: caddy:latest
Reproduction 2 — mocker lists an image it then denies exists
/tmp/mocker-rmi/
Dockerfile FROM docker.io/library/alpine:3.20
RUN echo hi > /hi
docker-compose.yml services:
tinysvc:
build: .
$ mocker compose build tinysvcSuccessfully built tinysvc
$ mocker images | grep tinytinysvc latest sha256:269b1 # listed
$ mocker rmi tinysvc:latestError: Error response from daemon: No such image: tinysvc:latest
$ mocker rmi docker.io/library/tinysvc:latestError: Error response from daemon: No such image: docker.io/library/tinysvc:latest
Both forms fail — the image is unreachable via rmi in any spelling, so there is no way to remove a mocker-built image with mocker. mocker images and mocker rmi disagree about the same reference string.
Reproduction 3 — short references fail for pulled images
$ mocker pull docker.io/library/busybox:1.37Status: Downloaded newer image for docker.io/library/busybox:1.37
$ mocker rmi docker.io/library/busybox:1.37Untagged: docker.io/library/busybox:1.37Deleted: sha256:9db7b59979c38555a39def84a31fb98b5296952f9e3afd4f6f11f05b07adfab0 # qualified: works
$ mocker rmi busybox:1.37Error: Error response from daemon: No such image: busybox:1.37 # short form: fails
Backend handles what mocker rejects
container image rm removes a bare-name image without trouble:
$ container image rm caddy:latestReclaimed 28.54 GB in disk spacecaddy:latest
$ container image ls | grep -i caddy # gone
So the capability is present underneath. container image rm is the workaround.
Expected
Resolve the reference as given first, then fall back to the normalized docker.io/library/... form — not the other way round. An exact match on the literal string the user typed should always win.
Accept short references for pulled images, matching docker rmi behavior.
When a reference is ambiguous across namespaces, either error and ask for a digest, or state which image was selected. Deleting a different image than the one named, with Deleted: <other digest> as the only hint, is the dangerous part.
#73 (bare service name as build tag) is what creates the ambiguous pair. This issue is what mis-resolves it destructively. Fixing #73 shrinks the blast radius, since builds would land on <project>-<service>:latest and stop colliding with base image names — but the resolution order here is worth fixing independently, as reproductions 2 and 3 do not depend on it.
mocker version: 0.7.2 (Homebrew) — macOS, Darwin 25.5.0, arm64
Summary
mocker rmiresolves image references only in their fully-qualified form. Consequences, worst first:rmi <name>:<tag>deletes the qualified image instead of the bare one and reports success — the wrong image is destroyed silently.FROM <base>then resolves to mocker's own previous build #73) cannot be removed through mocker at all.busybox:1.37— ordinarydocker rmiusage — fail withNo such image.The backend supports all of these; the gap is in mocker's reference resolution.
Reproduction 1 —
rmideletes the wrong imageStarting state, two distinct images both named
caddy:latest(the bare one produced bycompose buildper #73, the qualified one pulled from Docker Hub):Attempt to remove the build:
The official base was deleted. The build survived. The output reads as success, and nothing indicates a different image was targeted than the one named.
Repeating the command now fails, since the only remaining
caddy:latestis the bare-name build:Reproduction 2 — mocker lists an image it then denies exists
Both forms fail — the image is unreachable via
rmiin any spelling, so there is no way to remove a mocker-built image with mocker.mocker imagesandmocker rmidisagree about the same reference string.Reproduction 3 — short references fail for pulled images
Backend handles what mocker rejects
container image rmremoves a bare-name image without trouble:So the capability is present underneath.
container image rmis the workaround.Expected
docker.io/library/...form — not the other way round. An exact match on the literal string the user typed should always win.docker rmibehavior.Deleted: <other digest>as the only hint, is the dangerous part.Relationship to #73
#73 (bare service name as build tag) is what creates the ambiguous pair. This issue is what mis-resolves it destructively. Fixing #73 shrinks the blast radius, since builds would land on
<project>-<service>:latestand stop colliding with base image names — but the resolution order here is worth fixing independently, as reproductions 2 and 3 do not depend on it.