-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Summary
Finch rejects the combination of --rm and -d (--detach) flags in finch run, while Docker and Podman allow this combination. This is a common pattern used in development workflows.
Upstream Issue
This is an nerdctl limitation tracked at: containerd/nerdctl#1187 (open since July 2022)
Docker Behavior
# This works in Docker - runs detached and auto-removes on exit
docker run --rm -d --name mongo -p 27017:27017 mongo:latestFinch/nerdctl Behavior
# This fails with error
finch run --rm -d --name mongo -p 27017:27017 mongo:latest
# FATA[0000] flag -d and --rm cannot be specified togetherPodman Compatibility
Podman allows combining --rm and -d flags, matching Docker's behavior.
Use Cases
- Development Scripts: Many development scripts use
docker run --rm -dto start services that auto-cleanup when stopped - CI/CD Pipelines: Temporary containers that run in background and self-cleanup
- VS Code Docker Extension: Container lifecycle management workflows
Impact
This breaks compatibility with existing Docker scripts and workflows that rely on this flag combination. Users migrating from Docker to Finch encounter unexpected errors.
Workaround
A workaround for VS Code Docker extension is implemented in PR #327 - the extension avoids this flag combination when targeting Finch.
For CLI users, the workaround is to either:
- Skip
--rmand manually remove containers - Skip
-dand run in foreground (not always practical)
Suggested Action
Consider contributing the implementation upstream to nerdctl to maintain Docker CLI compatibility.