Install git and go packages in final target

Installs git and go packages in final target, as the go packages on
alpine are different than on the non-alpine variant.
This commit is contained in:
Mitchell Nielsen 2021-01-28 13:13:58 -05:00
parent 1496163214
commit e7e7a7cbe0

View file

@ -3,10 +3,7 @@ FROM golang:1.14 AS dependencies
ARG KUBEBUILDER_VERSION=2.3.1
ARG YQ_VERSION=2.4.1
RUN go get -u \
github.com/onsi/ginkgo/ginkgo \
golang.org/x/lint/golint \
&& curl -L https://go.kubebuilder.io/dl/${KUBEBUILDER_VERSION}/linux/amd64 | tar -xz -C /tmp/ \
RUN curl -L https://go.kubebuilder.io/dl/${KUBEBUILDER_VERSION}/linux/amd64 | tar -xz -C /tmp/ \
&& mv /tmp/kubebuilder_${KUBEBUILDER_VERSION}_linux_amd64 /usr/local/kubebuilder \
&& ln -sfv /usr/local/kubebuilder/bin/* /usr/local/bin
@ -24,3 +21,8 @@ COPY --from=dependencies /go /go
COPY --from=dependencies /usr/local/kubebuilder /usr/local/kubebuilder
COPY --from=dependencies /usr/local/bin/ /usr/local/bin/
COPY --from=dependencies /usr/local/bin/yq /usr/local/bin/yq
RUN apk add --no-cache git \
&& go get -u \
github.com/onsi/ginkgo/ginkgo \
golang.org/x/lint/golint \