docker / roadmap

Welcome to the Public Roadmap for All Things Docker! We welcome your ideas.
https://github.com/docker/roadmap/projects/1
Creative Commons Zero v1.0 Universal
1.45k stars 246 forks source link

Flag To Display Intermediate Containers on Docker Build #594

Open dwu359 opened 5 months ago

dwu359 commented 5 months ago

Tell us about your request Add a flag to docker and docker-compose CLIs to display the ids of intermediate containers while building a docker image from a Dockerfile.

Which service(s) is this request for? Docker CLI, docker-compose CLI

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? Intermediate containers are useful when debugging Dockerfiles, since you can enter into the last created intermediate container to replicate the state of the build process right before a step failed.

Are you currently working around the issue? DOCKER_BUILDKIT=0 seems to do the trick, although it would be helpful if this was better documented in the Docker Docs, if there was a flag dedicated to toggling Docker BuildKit, or if there was a way to display intermediate docker containers with Docker BuildKit.

Additional context

nicks commented 5 months ago

There is no id for the intermediate images because they are not exported to the image store. See this thread: https://github.com/moby/buildkit/issues/1053

colinhemmings commented 3 months ago

Hi @dwu359, thanks for the issue. Your workaround will fall back to the legacy builder supporting the intermediate containers. We are currently looking into options to support improved build debugging, enabling you to step through your build as it executes to inspect the state at each stage.