Skip to content

--rm=false does not keep intermediate containers as expected #1470

@bkomraz1

Description

@bkomraz1

Issue description

DOCKER_BUILDKIT=1 docker build --rm=false . does not keep intermediate containers as docker build --rm=false . keeps

# Dockerfile
FROM alpine:latest
LABEL debug=true

FROM alpine:latest

Steps to reproduce the issue

  1. docker system prune -f
  2. DOCKER_BUILDKIT=1 docker build --rm=false .
  3. docker ps -a -f label=debug=true

What's the expected result?

Step 1/3 : FROM alpine:latest
 ---> f70734b6a266
Step 2/3 : LABEL debug=true
 ---> Running in 773f64e4fbbe
 ---> d941f8903851
Step 3/3 : FROM alpine:latest
 ---> f70734b6a266
Successfully built f70734b6a266
CONTAINER ID        IMAGE               COMMAND                  CREATED                  STATUS              PORTS               NAMES
773f64e4fbbe        f70734b6a266        "/bin/sh -c '#(nop) …"   Less than a second ago   Created                                 friendly_heyrovsky

What's the actual result?

[+] Building 0.2s (5/5) FINISHED
 => [internal] load build definition from Dockerfile                                                                                         0.1s
 => => transferring dockerfile: 98B                                                                                                          0.1s
 => [internal] load .dockerignore                                                                                                            0.1s
 => => transferring context: 2B                                                                                                              0.1s
 => [internal] load metadata for docker.io/library/alpine:latest                                                                             0.0s
 => CACHED [stage-1 1/1] FROM docker.io/library/alpine:latest                                                                                0.0s
 => exporting to image                                                                                                                       0.0s
 => => exporting layers                                                                                                                      0.0s
 => => writing image sha256:db489feeb4704a920c415104748a2ceef4e8e97882957f8e279813bc362a040f                                                 0.0s
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions