Dockerfile: add mirror repos to global yum config

Copy mirror repo files to /etc/yum.repos.d because tb.sh needs them.
This change fixes a problem introduced by

  Commit: 78263e8784
  Dockerfile: pin centos & epel repo versions

that caused centos-mirror-tools/download_mirror.sh to fail when executed
from a docker container created by tb.sh -- "rpm not found" for most
packages being downloaded.

This is because download_mirror.sh without additional arguments expects
toCOPY/yum.repos.d/ files to have been copied to /etc/yum.repos.d/ in the
docker container by default.

Change-Id: If214aea6560632837d0f196c21801fc2d06c8259
Closes-Bug: 1885624
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
This commit is contained in:
Davlet Panech 2020-06-29 10:45:31 -04:00
parent fb25b76817
commit aa23b041b1
1 changed files with 11 additions and 0 deletions

View File

@ -251,6 +251,17 @@ RUN chown $MYUNAME /home/$MYUNAME && \
runuser -u $MYUNAME -- git config --global user.name $MYUNAME && \
runuser -u $MYUNAME -- git config --global color.ui false
# Customizations for mirror creation
RUN rm /etc/yum.repos.d/*
COPY centos-mirror-tools/yum.repos.d/* /etc/yum.repos.d/
COPY centos-mirror-tools/rpm-gpg-keys/* /etc/pki/rpm-gpg/
# Import GPG keys
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
# Try to continue a yum command even if a StarlingX repo is unavailable.
RUN yum-config-manager --setopt=StarlingX\*.skip_if_unavailable=1 --save
# When we run 'init' below, it will run systemd, and systemd requires RTMIN+3
# to exit cleanly. By default, docker stop uses SIGTERM, which systemd ignores.
STOPSIGNAL RTMIN+3