containers: update go version

With the recent release of go1.17 the oldest supported go version is
1.16. Update to the newest 1.16.z and clean up the structure of
the go install process a bit.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2021-08-26 11:06:49 -04:00 committed by mergify[bot]
parent ac2e61a699
commit 2456bf70a1

View File

@ -22,11 +22,14 @@ RUN true && \
yum clean all && \
true
ENV GOTAR=go1.15.10.linux-amd64.tar.gz
ARG GO_VERSION=1.16.7
ENV GO_VERSION=${GO_VERSION}
RUN true && \
curl -o /tmp/${GOTAR} https://dl.google.com/go/${GOTAR} && \
tar -x -C /opt/ -f /tmp/${GOTAR} && \
rm -f /tmp/${GOTAR} && \
gotar=go${GO_VERSION}.linux-amd64.tar.gz && \
gourl="https://dl.google.com/go/${gotar}" && \
curl -o /tmp/${gotar} "${gourl}" && \
tar -x -C /opt/ -f /tmp/${gotar} && \
rm -f /tmp/${gotar} && \
true
ENV PATH="${PATH}:/opt/go/bin"