Dockerfile: relocate "yum install golang"

Dockerfile command "RUN yum install -y golang" failed with a
404 error on ftp.iij.ad.jp/pub/linux/centos/7/rt/x86_64.

In the Dockerfile, we are trying to run....
   RUN yum install -y golang
after we install StarlingX repos into /etc/yum.repos.d/ with
   COPY centos-mirror-tools/yum.repos.d/* /etc/yum.repos.d/

All 'yum install' commands must preceed any modifications to
/etc/yum.repos.d in support of StarlingX package downloading!

I'll also add 'skip_if_unavailable' to all StarlingX repos
in case other build scripts introduce a 'yum install'.

NOTE: Package downloading itself will try CENGN's mirror in
addition to the primary site.  So unavailability of a single
site isn't fatal in that case.

Change-Id: If0220d3d5742810b0927f8e55e0093f0f0172c59
Closes-Bug: 1833444
Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
Scott Little 2019-06-19 12:34:50 -04:00
parent 3d0bb7d0f8
commit 67e2d3e4c0
1 changed files with 10 additions and 5 deletions

View File

@ -43,7 +43,7 @@ RUN groupadd -g 751 cgts && \
echo "mock:x:751:root" >> /etc/group && \
echo "mockbuild:x:9001:" >> /etc/group && \
yum install -y epel-release && \
yum install -y anaconda \
yum install -y anaconda \
anaconda-help \
anaconda-runtime \
autoconf-archive \
@ -122,6 +122,13 @@ RUN pip install python-subunit junitxml --upgrade && \
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo && \
chmod a+x /usr/local/bin/repo
# installing go and setting paths
ENV GOPATH="/usr/local/go"
ENV PATH="${GOPATH}/bin:${PATH}"
RUN yum install -y golang && \
mkdir -p ${GOPATH}/bin && \
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
# mock time
# forcing chroots since a couple of packages naughtily insist on network access and
# we dont have nspawn and networks happy together.
@ -233,10 +240,8 @@ COPY centos-mirror-tools/rpm-gpg-keys/* /etc/pki/rpm-gpg/
# Import GPG keys
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
# installing go and setting paths
ENV GOPATH="/usr/local/go"
ENV PATH="${GOPATH}/bin:${PATH}"
RUN yum install -y golang; mkdir -p ${GOPATH}/bin; curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
# Try to continue a yum command even if a StarlingX repo is unavailable.
RUN yum-config-manager --setopt=StarlingX\*.skip_if_unavailable=1 --save
# Don't know if it's possible to run services without starting this
CMD /usr/sbin/init