Skip to content

rmi cannot remove an image by ID or digest prefix #79

Description

@us

Follow-up from #76, which fixed reference resolution but deliberately left IDs out of scope.

docker rmi accepts an image ID or a short digest prefix, which is what makes the common cleanup one-liner work:

mocker images -q | xargs mocker rmi

Today ImageManager.resolve only tries reference strings (the literal ref, <name>:latest, then the normalized docker.io/library/... form). The underlying ReferenceManager.get is an exact string match on the reference, with no digest or ID lookup at all, so an ID argument always ends in No such image.

A fix would resolve an argument that looks like a digest (sha256:...) or a hex prefix against the stored images' digests, and error on an ambiguous prefix rather than picking one. mocker images -q prints short IDs, so prefix matching is the part that actually matters for the workflow above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions