Docker Compose deploy fails when Dockerfile final stage has no CMD/ENTRYPOINT (FROM scratch)
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
## Description
When using a multi-stage Dockerfile where the final stage is `FROM scratch` (or any minimal base with no default command), Docker Compose deployment fails with "no command specified". This happens even when the container is only used as a build artifact (its image is referenced by another service's build).
## Expected behavior
If a resource's container is only used as a build dependency (e.g., its image is referenced in another service's Dockerfile `COPY --from=`), it shouldn't need a CMD/ENTRYPOINT. Aspire should either:
- Not add the container as a compose service if it's only a build artifact
- Or handle the "no command" case gracefully
## Workaround
Use a base image with a shell for the final stage (e.g., `FROM busybox` with `CMD ["true"]`), or restructure the Dockerfile to use a real runtime as the final stage.
## Environment
- Aspire SDK: 13.2.1 (TypeScript)
- Target: Docker Compose (`addDockerComposeEnvironment`)
Contributor guide
Assessment
This issue has not been assessed yet.