-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile.dapper
42 lines (35 loc) · 1.48 KB
/
Dockerfile.dapper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM registry.suse.com/bci/golang:1.22 AS helm
ARG HELM_VERSION=v3.13.3-rancher1
RUN zypper -n install git
RUN git -C / clone --branch $HELM_VERSION --depth=1 https://github.com/rancher/helm
RUN make -C /helm
FROM registry.suse.com/bci/golang:1.22
# Add buildx plugin
COPY --from=docker.io/docker/buildx-bin:0.17.1 /buildx /usr/libexec/docker/cli-plugins/docker-buildx
ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
RUN zypper -n install git docker vim less file curl wget patch
RUN go install golang.org/x/tools/cmd/goimports@latest
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2; \
fi
ENV YQ_VERSION=v4.30.8
RUN wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${ARCH} -O /usr/bin/yq && chmod +x /usr/bin/yq;
COPY --from=helm ./helm/bin/helm /usr/local/bin/
RUN if [ "${ARCH}" != "s390x" ]; then \
helm plugin install https://github.com/quintush/helm-unittest; \
fi
ENV DAPPER_ENV REPO TAG HELM_IMAGE_TAG HELM_CHART_VERSION HELM_CHART_VERSION_DEV CROSS CROSS_ARCH USE_DOCKER_BUILDX TARGET_ARCH
ENV DAPPER_SOURCE /go/src/github.com/rancher/helm-project-operator/
ENV DAPPER_OUTPUT ./bin ./dist
ENV GOCACHE /root/.cache/go-build
ENV GOPATH /go
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_RUN_ARGS --privileged
VOLUME /var/lib/rancher/k3s
VOLUME /var/lib/cni
VOLUME /var/log
ENV HOME ${DAPPER_SOURCE}
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]