From 7697d7561de94c57ddd8f1c8e4189130d6b3f3d6 Mon Sep 17 00:00:00 2001 From: Drew Walters Date: Tue, 10 Nov 2020 16:50:36 +0000 Subject: [PATCH] Update Go base images Recently, Docker.io imposed container registry pull limits, and we have exceeded them. This has impacted continuous-integration testing in this repository. This change updates our base Go images from those hosted on docker.io to gcr.io in order to circumnavigate pull restrictions. Change-Id: I2a990846b1a49010ff2a403d99413d8162322804 Signed-off-by: Drew Walters --- Dockerfile | 6 +++++- krm-functions/replacement-transformer/Dockerfile.sample | 6 +++--- krm-functions/templater/Dockerfile.sample | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index e32c158fc..7c55d73b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG GO_IMAGE=docker.io/golang:1.13.1-stretch +ARG GO_IMAGE=gcr.io/gcp-runtimes/go1-builder:1.13 ARG RELEASE_IMAGE=scratch FROM ${GO_IMAGE} as builder @@ -9,6 +9,8 @@ LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc org.opencontainers.image.vendor='The Airship Authors' \ org.opencontainers.image.licenses='Apache-2.0' +ENV PATH "/usr/local/go/bin:$PATH" + # Inject custom root certificate authorities if needed # Docker does not have a good conditional copy statement and requires that a source file exists # to complete the copy function without error. Therefore the README.md file will be copied to @@ -16,6 +18,8 @@ LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc COPY ./certs/* /usr/local/share/ca-certificates/ RUN update-ca-certificates +RUN apt-get update -yq && apt-get upgrade -yq && apt-get install -y gcc make + SHELL [ "/bin/bash", "-cex" ] WORKDIR /usr/src/airshipctl diff --git a/krm-functions/replacement-transformer/Dockerfile.sample b/krm-functions/replacement-transformer/Dockerfile.sample index 5cf4c1604..d114a6758 100644 --- a/krm-functions/replacement-transformer/Dockerfile.sample +++ b/krm-functions/replacement-transformer/Dockerfile.sample @@ -1,10 +1,10 @@ -FROM golang:1.13-stretch as builder +FROM gcr.io/gcp-runtimes/go1-builder:1.13 as builder ENV CGO_ENABLED=0 WORKDIR /go/src/ COPY image/go.mod . -RUN go mod download +RUN /usr/local/go/bin/go mod download COPY main.go . -RUN go build -v -o /usr/local/bin/config-function ./ +RUN /usr/local/go/bin/go build -v -o /usr/local/bin/config-function ./ FROM alpine:latest COPY --from=builder /usr/local/bin/config-function /usr/local/bin/config-function diff --git a/krm-functions/templater/Dockerfile.sample b/krm-functions/templater/Dockerfile.sample index 5cf4c1604..d114a6758 100644 --- a/krm-functions/templater/Dockerfile.sample +++ b/krm-functions/templater/Dockerfile.sample @@ -1,10 +1,10 @@ -FROM golang:1.13-stretch as builder +FROM gcr.io/gcp-runtimes/go1-builder:1.13 as builder ENV CGO_ENABLED=0 WORKDIR /go/src/ COPY image/go.mod . -RUN go mod download +RUN /usr/local/go/bin/go mod download COPY main.go . -RUN go build -v -o /usr/local/bin/config-function ./ +RUN /usr/local/go/bin/go build -v -o /usr/local/bin/config-function ./ FROM alpine:latest COPY --from=builder /usr/local/bin/config-function /usr/local/bin/config-function