switch image base from alpine to debian

This commit is contained in:
Dustin Collins 2021-11-02 14:55:32 -05:00
parent d837840867
commit 62ba2325f1
No known key found for this signature in database
GPG key ID: 6A0DAB9E31F49A8F

View file

@ -1,18 +1,18 @@
ARG GOLANG_VERSION=1.16
## Kustomize
FROM golang:${GOLANG_VERSION}-alpine as kustomize
FROM golang:${GOLANG_VERSION} as kustomize
ARG KUSTOMIZE_VERSION=3.8.10
ENV GOPROXY="https://proxy.golang.org/"
RUN apk add --no-cache gcc musl-dev
RUN apt-get update && apt-get install -y gcc && apt-get clean
RUN mkdir /src && cd /src; \
go mod init tmp && \
go get sigs.k8s.io/kustomize/kustomize/v3@v${KUSTOMIZE_VERSION}
## Controller-gen
FROM golang:${GOLANG_VERSION}-alpine as controller-gen
FROM golang:${GOLANG_VERSION} as controller-gen
ARG CONTROLLER_GEN_VERSION=0.3.0
ENV GOPROXY="https://proxy.golang.org/"
@ -22,7 +22,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} as build
LABEL maintainer="GitLab Distribution Team" \
description="Build base image for the GitLab Operator project."
@ -33,7 +33,9 @@ ARG OPM_VERSION=1.19.1
ARG YQ_VERSION=4.7.0
ARG HELM_VERSION=3.5.2
RUN apk add --no-cache podman buildah curl make gcc musl-dev git bash coreutils
RUN apt-get update && apt-get install -y \
podman buildah curl make gcc git bash coreutils \
&& apt-get clean
RUN go get -u \
github.com/onsi/ginkgo/ginkgo \
golang.org/x/lint/golint
@ -69,7 +71,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}
LABEL maintainer="GitLab Distribution Team" \
description="Build base image for the GitLab Operator project."
COPY --from=build / /