Dockerfile: fail in "yum install" on missing packages
By default "yum install" ignores packages that can't be downloaded and
return 0 to the shell.
In a Dockerfile such falsely successful commands are cached by
"docker build", so that the next time we run "docker build" the
"yum install" is not even attempted:
# this "succeeds" and gets cached during the first "docker build",
# even if the URL returns an error (eg DNS error or HTTP 404).
# During a second "docker build" this bringis back the FS layer
# from the cache and doesn't attempt to re-download the package
# from that URL
RUN yum install python3 http://some/url.rpm
...
This patch avoids the problem in case CENGN mirror is down.
Reviewed: https:/ /review. opendev. org/c/starlingx /tools/ +/786140 /opendev. org/starlingx/ tools/commit/ b1119360cb90b18 6ea6e3c030c96dd 924eaa9c08
Committed: https:/
Submitter: "Zuul (22348)"
Branch: f/centos8
commit b1119360cb90b18 6ea6e3c030c96dd 924eaa9c08
Author: Davlet Panech <email address hidden>
Date: Wed Jan 27 19:06:41 2021 -0500
Dockerfile: fail in "yum install" on missing packages
By default "yum install" ignores packages that can't be downloaded and
return 0 to the shell.
In a Dockerfile such falsely successful commands are cached by
"docker build", so that the next time we run "docker build" the
"yum install" is not even attempted:
# this "succeeds" and gets cached during the first "docker build", some/url. rpm
# even if the URL returns an error (eg DNS error or HTTP 404).
# During a second "docker build" this bringis back the FS layer
# from the cache and doesn't attempt to re-download the package
# from that URL
RUN yum install python3 http://
...
This patch avoids the problem in case CENGN mirror is down.
Closes-Bug: 1912682 ac830c9f609f032 4996e7c432) 7e01aa194ebbf31 46959f827e6
Signed-off-by: Davlet Panech <email address hidden>
(cherry picked from commit 511859ef18129b3
Change-Id: Ia4abcce3e2bc69