Failed builds leave temporary containers on node

Solution Verified - Updated -

Issue

After running a build that fails in a node, the container created to run the build remains there, it's not removed automatically. Even the node can run out of space when the number of temporary containers increases.

A new build fails:

$ oc logs failing-build-1-build 
Step 1 : FROM centos/ruby-22-centos7@sha256:b2637a0ae69beb30111425fd381d5ff01acb0d71e9d61b491c3eaba54e5428ef
 ---> 1f024693ec8a
Step 2 : RUN exit 1
 ---> Running in c7d006c00944
error: build error: The command '/bin/sh -c exit 1' returned a non-zero code: 1

After build error, temporary container remains on the node:

# docker ps -a | grep -v k8s_ | grep Exited
c7d006c00944        1f024693ec8a                                                                                                                       "/bin/sh -c 'exit 1'"    5 minutes ago       Exited (1) 5 minutes ago                       silly_kare

Environment

  • OpenShift
    • 3.6
    • 3.7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content