fix alpine version

This commit is contained in:
Dmitry Makovey 2021-10-14 10:38:25 -06:00
parent 7f8ce99ece
commit e474a539bd

View file

@ -1,7 +1,9 @@
ARG GOLANG_VERSION=1.16
# 3.14 presents challenges: https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2
ARG ALPINE_VERSION=3.14
## Kustomize
FROM golang:${GOLANG_VERSION}-alpine as kustomize
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} as kustomize
ARG KUSTOMIZE_VERSION=3.8.10
ENV GOPROXY="https://proxy.golang.org/"
@ -13,12 +15,12 @@ RUN mkdir /src && cd /src; \
## Opm
FROM golang:${GOLANG_VERSION}-alpine as opm
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} as opm
ARG OPM_VERSION=1.19.0
ENV GOPROXY="https://proxy.golang.org/"
RUN apk add --no-cache make gcc musl-dev curl
RUN apk add --no-cache make gcc musl-dev curl git
## on Alpine opm needs to be built from scratch due to glibc vs musl issues
RUN mkdir -p /src \
@ -30,7 +32,7 @@ RUN mkdir -p /src \
&& make bin/opm
## Controller-gen
FROM golang:${GOLANG_VERSION}-alpine as controller-gen
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} as controller-gen
ARG CONTROLLER_GEN_VERSION=0.3.0
ENV GOPROXY="https://proxy.golang.org/"
@ -40,7 +42,7 @@ RUN mkdir /src && cd /src; \
&& go get sigs.k8s.io/controller-tools/cmd/controller-gen@v${CONTROLLER_GEN_VERSION}
## Build
FROM golang:${GOLANG_VERSION}-alpine as build
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} as build
LABEL maintainer="GitLab Distribution Team" \
description="Build base image for the GitLab Operator project."
@ -90,7 +92,7 @@ COPY --from=kustomize /go/bin/kustomize /usr/local/bin/kustomize
COPY --from=controller-gen /go/bin/controller-gen /usr/local/bin/controller-gen
## Final image
FROM golang:${GOLANG_VERSION}-alpine
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION}
LABEL maintainer="GitLab Distribution Team" \
description="Build base image for the GitLab Operator project."
COPY --from=build / /