forked from rancher/system-upgrade-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dapper
49 lines (44 loc) · 1.9 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
43
44
45
46
47
48
49
ARG KUBECTL=rancher/kubectl:v1.17.0
# ARG SONOBUOY=sonobuoy/sonobuoy:v0.17.2
# FROM ${SONOBUOY} AS sonobuoy
FROM ${KUBECTL} AS kubectl
FROM golang:1.13-alpine
COPY --from=kubectl /bin/kubectl /usr/local/bin/kubectl
# COPY --from=sonobuoy /sonobuoy /usr/local/bin/sonobuoy
ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
RUN apk -U add coreutils bash expect git gcc jq musl-dev docker docker-compose vim less file curl wget ca-certificates iproute2
RUN go get -d golang.org/x/lint/golint && \
git -C /go/src/golang.org/x/lint/golint checkout -b current 06c8688daad7faa9da5a0c2f163a3d14aac986ca && \
go install golang.org/x/lint/golint && \
rm -rf /go/src /go/pkg
RUN mkdir -p /go/src/golang.org/x && \
cd /go/src/golang.org/x && git clone https://github.com/golang/tools && \
git -C /go/src/golang.org/x/tools checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 && \
go install golang.org/x/tools/cmd/goimports
RUN rm -rf /go/src /go/pkg
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.15.0; \
fi
RUN if [ "${ARCH}" == "amd64" ]; then \
GO111MODULE=on go get sigs.k8s.io/kustomize/kustomize/[email protected]; \
fi
ARG SONOBUOY_VERSION=0.17.2
RUN if [ "${ARCH}" != "arm" ]; then \
set -x; \
curl -sL "https://github.com/vmware-tanzu/sonobuoy/releases/download/v${SONOBUOY_VERSION}/sonobuoy_${SONOBUOY_VERSION}_linux_${ARCH}.tar.gz" \
| tar -xz -C /usr/local/bin; \
chmod +x /usr/local/bin/sonobuoy; \
fi
# ENV DAPPER_RUN_ARGS --privileged
ENV DAPPER_ENV REPO TAG DRONE_TAG
ENV DAPPER_SOURCE /go/src/github.com/rancher/system-upgrade-controller/
ENV DAPPER_OUTPUT ./bin ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}
ENV KUBECONFIG /root/.kube/config
ENV KUBEHOST 172.17.0.1
ENV GO111MODULE off
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]