Red Hat Bugzilla – Bug 1532966
oc ex dockergc still remove the image though '--dry-run=true'
Last modified: 2018-03-28 10:18:46 EDT
Description of problem: Even I set '--dry-run=true', the oc ex dockergc command still clean the image Version-Release number of selected component (if applicable): openshift v3.9.0-0.16.0 kubernetes v1.9.0-beta1 etcd 3.2.8 How reproducible: Always Steps to Reproduce: 1. remove the image with '--dry-run=true' [root@ip-172-18-10-210 ~]# docker pull centos:centos7 Trying to pull repository registry.reg-aws.openshift.com:443/centos ... Trying to pull repository registry.access.redhat.com/centos ... Trying to pull repository registry.access.redhat.com/centos ... Trying to pull repository docker.io/library/centos ... centos7: Pulling from docker.io/library/centos af4b0a2388c6: Already exists Digest: sha256:2671f7a3eea36ce43609e9fe7435ade83094291055f1c96d9d1d1d7c0b986a5d [root@ip-172-18-10-210 ~]# [root@ip-172-18-10-210 ~]# [root@ip-172-18-10-210 ~]# [root@ip-172-18-10-210 ~]# oc ex dockergc --image-gc-high-threshold=30 --image-gc-low-threshold=20 --dry-run=true docker build garbage collection daemon MinimumGCAge: {1h0m0s}, ImageGCHighThresholdPercent: 30, ImageGCLowThresholdPercent: 20 gathering disk usage data usage exceeds high threshold (12500MB > 9303MB), attempting to free 6298MB 0 exited containers found skipping infra image docker.io/openshift/mysql-55-centos7:latest skipping infra image docker.io/openshift/php-55-centos7:latest skipping infra image docker.io/openshift/origin-metrics-hawkular-metrics:latest skipping infra image docker.io/openshift/wildfly-101-centos7:latest removing image sha256:ff426288ea903fcf8d91aca97460c613348f7a27195606b45f19ae91776ca23d (size: 207198847, age: 34h11m29.619059176s) skipping infra image docker.io/openshift/jenkins-2-centos7:latest skipping infra image docker.io/openshift/origin-deployer:latest [root@ip-172-18-10-210 ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/openshift/origin-deployer latest bcfd389d2585 About an hour ago 1.277 GB docker.io/openshift/jenkins-2-centos7 latest 4dcb08e555ad 5 hours ago 2.211 GB docker.io/openshift/wildfly-101-centos7 latest fad1e0510edd 8 weeks ago 943.6 MB docker.io/openshift/origin-metrics-hawkular-metrics latest 67c1503b2ae2 9 weeks ago 914.4 MB docker.io/openshift/php-55-centos7 latest 089abeb67362 12 months ago 539.3 MB docker.io/openshift/mysql-55-centos7 latest 968db52211da 13 months ago 384.6 MB Actual results: Expected results: 1. Should remove the image if '--dry-run=true' Additional info:
This was reported here https://github.com/openshift/origin/issues/17443 And the PR that fixes it still hasn't merged and fell off my radar :-/ https://github.com/openshift/origin/pull/17479
Checked with v3.9.0-0.22.0 and dry-run=true now will not removing the images, so verify this. # docker pull jenkins Using default tag: latest Trying to pull repository registry.reg-aws.openshift.com:443/jenkins ... Trying to pull repository registry.access.redhat.com/jenkins ... Trying to pull repository registry.access.redhat.com/jenkins ... Trying to pull repository docker.io/library/jenkins ... latest: Pulling from docker.io/library/jenkins 723254a2c089: Pull complete abe15a44e12f: Pull complete 409a28e3cc3d: Pull complete 503166935590: Pull complete 043a12c29ea4: Pull complete 303620452447: Pull complete c61f95baa024: Pull complete 3f2018472a1f: Pull complete a25f8a69c882: Pull complete ef0799915650: Pull complete d9a52178f3f2: Pull complete 21d8e85eda47: Pull complete d1a59d3cef17: Pull complete 5736476dca56: Pull complete 677d0ef908aa: Pull complete 10d71ec5b7fd: Pull complete 768022bc0860: Pull complete 878faf994156: Pull complete 0030f731e722: Pull complete 13749a7f1512: Pull complete Digest: sha256:b80cf491f1b4e6d490441eb54ae184f74abbd9f790495367afb7b9f1b3a7f2c9 [root@ip-172-18-4-192 ~]# oc ex dockergc --image-gc-high-threshold=25 --image-gc-low-threshold=20 --dry-run=true I0123 03:03:15.958691 4554 dockergc.go:242] docker build garbage collection daemon I0123 03:03:15.958781 4554 dockergc.go:244] Running in dry-run mode I0123 03:03:15.958788 4554 dockergc.go:246] MinimumGCAge: {1h0m0s}, ImageGCHighThresholdPercent: 25, ImageGCLowThresholdPercent: 20 I0123 03:03:15.983756 4554 dockergc.go:150] gathering disk usage data I0123 03:03:16.001365 4554 dockergc.go:165] usage exceeds high threshold (9578MB > 7752MB), attempting to free 3376MB I0123 03:03:16.003683 4554 dockergc.go:174] 2 exited containers found I0123 03:03:16.003702 4554 dockergc.go:186] removing container 99a88082c4325038a297c526ba3656245966a297d5094e3362bf1d1cef83a854 (size: 0, age: 2h8m55.003697434s) I0123 03:03:16.003714 4554 dockergc.go:183] remaining containers are too young I0123 03:03:16.010002 4554 dockergc.go:204] 13 images found I0123 03:03:16.010020 4554 dockergc.go:224] removing image sha256:1984e08b2e256627964bf65b631c36350fbcef73506ac2dface1ee537ef26963 (size: 576042687, age: 1462h40m27.010013999s) I0123 03:03:16.010033 4554 dockergc.go:224] removing image sha256:5a98b74c0806eb6e94ed009b3d792c8d6411ce62c608b04caef8eea6c887bce9 (size: 248413279, age: 1360h34m22.010028583s) I0123 03:03:16.010043 4554 dockergc.go:224] removing image sha256:5fc84ab0b7ad231bbde5efafecc6b400d7718ed8bf7cb8bad41cdeeffd4c3844 (size: 809029631, age: 997h32m35.010039451s) I0123 03:03:16.010054 4554 dockergc.go:224] removing image sha256:f9b6f7f7b9d34113f66e16a9da3e921a580937aec98da344b852ca540aaa2242 (size: 1143105, age: 177h28m48.010049554s) I0123 03:03:16.010064 4554 dockergc.go:224] removing image sha256:ee7d16a124485dac09d462ea0d51573884ff4c74ce07a7ed4cd3a016b8e8db2e (size: 279757798, age: 88h46m58.010059723s) I0123 03:03:16.010074 4554 dockergc.go:224] removing image sha256:34e4c23f23f8ed7bc95d1dc7ac27681462d8ebac34841610f8545eb1393859fa (size: 269051668, age: 88h46m47.01006988s) I0123 03:03:16.010084 4554 dockergc.go:224] removing image sha256:6ecd08fc8dfd71280356a9a95670483a3bd2a056b5f93afa19a25a8684a9d0a7 (size: 208964273, age: 76h23m37.01007975s) I0123 03:03:16.010093 4554 dockergc.go:224] removing image sha256:84fa943797e225338485b9671b4ebacfca3ed39c2da100c659c386aa585e1ccc (size: 463535265, age: 75h39m36.01008952s) I0123 03:03:16.010103 4554 dockergc.go:224] removing image sha256:3fd545967525d6b964ac3066f3b0b52390affa99bf1ba65ad43969c557c8e31d (size: 1222927259, age: 75h37m55.010099413s) I0123 03:03:16.010113 4554 dockergc.go:207] usage is below low threshold, freed 3889MB [root@ip-172-18-4-192 ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/openshift/hello-openshift latest ac8ca240a0a5 About an hour ago 6.09 MB docker.io/openshift/hello-openshift <none> f01dd73a0489 5 hours ago 6.09 MB registry.reg-aws.openshift.com:443/openshift3/openvswitch v3.9.0 5675f6a99b36 3 days ago 1.414 GB registry.reg-aws.openshift.com:443/openshift3/node v3.9.0 e9ee6e87d9bc 3 days ago 1.412 GB registry.reg-aws.openshift.com:443/openshift3/ose v3.9 3fd545967525 3 days ago 1.223 GB registry.reg-aws.openshift.com:443/openshift3/ose v3.9.0 3fd545967525 3 days ago 1.223 GB registry.reg-aws.openshift.com:443/openshift3/ose-web-console v3.9 84fa943797e2 3 days ago 463.5 MB registry.reg-aws.openshift.com:443/openshift3/ose-pod v3.9.0-0.22.0 6ecd08fc8dfd 3 days ago 209 MB registry.reg-aws.openshift.com:443/openshift3/ose-service-catalog v3.7 34e4c23f23f8 3 days ago 269.1 MB registry.reg-aws.openshift.com:443/openshift3/ose-template-service-broker v3.7 ee7d16a12448 3 days ago 279.8 MB docker.io/busybox latest f9b6f7f7b9d3 7 days ago 1.143 MB docker.io/jenkins latest 5fc84ab0b7ad 5 weeks ago 809 MB registry.access.redhat.com/rhel7/etcd latest 5a98b74c0806 8 weeks ago 248.4 MB registry.access.redhat.com/rhscl/mongodb-32-rhel7 <none> 1984e08b2e25 8 weeks ago 576 MB
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0489