mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-12 19:42:55 +01:00
merge master
This commit is contained in:
commit
d837840867
41 changed files with 1654 additions and 476 deletions
|
|
@ -1,33 +1,75 @@
|
|||
FROM golang:1.17
|
||||
ARG GOLANG_VERSION=1.16
|
||||
|
||||
## Kustomize
|
||||
FROM golang:${GOLANG_VERSION}-alpine as kustomize
|
||||
|
||||
ARG KUSTOMIZE_VERSION=3.8.10
|
||||
ENV GOPROXY="https://proxy.golang.org/"
|
||||
|
||||
RUN apk add --no-cache gcc musl-dev
|
||||
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
|
||||
|
||||
ARG CONTROLLER_GEN_VERSION=0.3.0
|
||||
ENV GOPROXY="https://proxy.golang.org/"
|
||||
|
||||
RUN mkdir /src && cd /src; \
|
||||
go mod init tmp \
|
||||
&& go get sigs.k8s.io/controller-tools/cmd/controller-gen@v${CONTROLLER_GEN_VERSION}
|
||||
|
||||
## Build
|
||||
FROM golang:${GOLANG_VERSION}-alpine as build
|
||||
|
||||
LABEL maintainer="GitLab Distribution Team" \
|
||||
description="Build base image for the GitLab Operator project."
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
buildah \
|
||||
&& apt-get clean
|
||||
|
||||
RUN go get -u \
|
||||
github.com/onsi/ginkgo/ginkgo \
|
||||
golang.org/x/lint/golint
|
||||
|
||||
ARG KUBEBUILDER_VERSION=2.3.1
|
||||
ARG OPERATOR_SDK_VERSION=1.13.1
|
||||
ARG OPM_VERSION=1.19.1
|
||||
ARG YQ_VERSION=2.4.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 go get -u \
|
||||
github.com/onsi/ginkgo/ginkgo \
|
||||
golang.org/x/lint/golint
|
||||
|
||||
# Kubebuilder
|
||||
RUN curl --retry 6 -Ls https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KUBEBUILDER_VERSION}/kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64.tar.gz | tar -xz -C /tmp/ \
|
||||
&& mv /tmp/kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64 /usr/local/kubebuilder \
|
||||
&& ln -sfv /usr/local/kubebuilder/bin/* /usr/local/bin
|
||||
|
||||
# Operator SDK
|
||||
RUN curl --retry 6 -LsO https://github.com/operator-framework/operator-sdk/releases/download/v${OPERATOR_SDK_VERSION}/operator-sdk_linux_amd64 \
|
||||
&& chmod +x operator-sdk_linux_amd64 \
|
||||
&& mv operator-sdk_linux_amd64 /usr/local/bin/operator-sdk
|
||||
|
||||
# OPM
|
||||
RUN curl --retry 6 -LsO https://github.com/operator-framework/operator-registry/releases/download/v${OPM_VERSION}/linux-amd64-opm \
|
||||
&& chmod +x linux-amd64-opm \
|
||||
&& mv linux-amd64-opm /usr/local/bin/opm
|
||||
|
||||
RUN curl --retry 6 -LsO https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 \
|
||||
&& chmod +x yq_linux_amd64 \
|
||||
&& mv yq_linux_amd64 /usr/local/bin/yq
|
||||
# Yq
|
||||
RUN curl --retry 6 -LsO https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64 \
|
||||
&& chmod +x yq_linux_amd64 \
|
||||
&& mv yq_linux_amd64 /usr/local/bin/yq
|
||||
|
||||
# Helm
|
||||
RUN curl --retry 6 -Ls "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" | tar -xz -C /tmp/ \
|
||||
&& chmod +x /tmp/linux-amd64/helm \
|
||||
&& mv /tmp/linux-amd64/helm /usr/local/bin/helm
|
||||
|
||||
# Kustomize
|
||||
COPY --from=kustomize /go/bin/kustomize /usr/local/bin/kustomize
|
||||
# Controller-gen
|
||||
COPY --from=controller-gen /go/bin/controller-gen /usr/local/bin/controller-gen
|
||||
|
||||
## Final image
|
||||
FROM golang:${GOLANG_VERSION}-alpine
|
||||
LABEL maintainer="GitLab Distribution Team" \
|
||||
description="Build base image for the GitLab Operator project."
|
||||
COPY --from=build / /
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue