Skip to content

[17.10-rc1] Build containers not being removed after failing build #35116

@shin-

Description

@shin-

Description

A failing docker build now preserves all intermediary build containers, while previous versions removed them.

Steps to reproduce the issue:

  1. Create failing Dockerfile:
FROM busybox:latest
LABEL com.docker.compose.test_image=true
LABEL com.docker.compose.test_failing_image=true
RUN exit 1

  1. Run docker build --no-cache . | grep "Running in" | cut -d' ' -f5 | xargs docker inspect | grep '"Id"'
  2. Note how all 3 containers have been preserved.

Describe the results you received:

Build containers remained

Describe the results you expected:

Build containers are removed

$ ~/engines/docker-1.10.2 build --no-cache . | grep "Running in" | cut -d' ' -f5 | xargs ~/engines/docker-1.10.2 inspect
Error: No such image or container: 1ce422fe7da2

Additional information you deem important (e.g. issue happens only occasionally):

This error also affects Compose (docker/compose#5242), so it's not a CLI bug.

Output of docker version:

$ docker version
Client:
 Version:      17.10.0-ce-rc1
 API version:  1.33
 Go version:   go1.8.3
 Git commit:   d866876
 Built:        Wed Oct  4 21:45:54 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.10.0-ce-rc1
 API version:  1.33 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   d866876
 Built:        Wed Oct  4 21:44:33 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

Containers: 17
 Running: 0
 Paused: 0
 Stopped: 17
Images: 372
Server Version: 17.10.0-ce-rc1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 446
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 0351df1c5a66838d0c392b4ac4cf9450de844e2d
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-92-generic
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.499GiB
Name: yuna
ID: YZQG:AKYJ:JQXJ:CEHT:62DP:PMWA:S43W:5X47:SSOE:UXGG:XHWS:555F
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/builderBuildkind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.version/17.10

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions