Map build host repos to distro.repos.d instead of yum.repos.d

Currently, when building container images, we are overriding the ubi
image repos with the repos configured in the host. Effectively, this is
removing ubi repo config from the image build environment which most of
the times is not a problem as centos is on sync with ubi, but in some
cases as after RHEL 8.3 release, ubi is ahead of CentOS and need
packages from the ubi repo itself.

This patch is bind mounting the repos config from build host in
distro.repos.d instead of yum.repos.d. In that way, both the repos
configured by default in the image (ubi repos) and the ones in the host
are available.

Depends-On: https://review.opendev.org/c/openstack/tripleo-common/+/765078
Closes-Bug: #1902846
Change-Id: I55f4b8cf2ad971e196fbd06db743d07ce3135ea8
(cherry picked from commit a4fdf46d83)
(cherry picked from commit 93e4fbde06)
This commit is contained in:
yatinkarel 2020-11-06 11:58:19 +05:30
parent 43773f5a05
commit 5201476244
2 changed files with 2 additions and 2 deletions

View File

@ -180,7 +180,7 @@ class TestContainerImages(deploy_fakes.TestDeployOvercloud):
(
"volumes",
[
"/etc/yum.repos.d:/etc/yum.repos.d:z",
"/etc/yum.repos.d:/etc/distro.repos.d:z",
"/etc/pki/rpm-gpg:/etc/pki/rpm-gpg:z",
"bind/mount",
],

View File

@ -189,7 +189,7 @@ class Build(command.Command):
dest="volumes",
metavar="<volume-path>",
default=[
"/etc/yum.repos.d:/etc/yum.repos.d:z",
"/etc/yum.repos.d:/etc/distro.repos.d:z",
"/etc/pki/rpm-gpg:/etc/pki/rpm-gpg:z",
],
action="append",