forked from rancher/system-upgrade-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.build
More file actions
30 lines (28 loc) · 1.2 KB
/
Dockerfile.build
File metadata and controls
30 lines (28 loc) · 1.2 KB
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
ARG GOLANG=golang:1.13-alpine
FROM ${GOLANG} AS prepare
ARG ARCH
RUN apk --no-cache add \
bash \
ca-certificates \
curl \
gcc \
git
COPY ./ /go/src/github.com/rancher/system-upgrade-controller/
WORKDIR /go/src/github.com/rancher/system-upgrade-controller
RUN chmod +x /go/src/github.com/rancher/system-upgrade-controller/scripts/*
FROM prepare AS build
RUN /go/src/github.com/rancher/system-upgrade-controller/scripts/entry build
FROM build AS validate
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 go get -d golang.org/x/tools || true \
&& git -C /go/src/golang.org/x/tools checkout -b current aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 \
&& go install golang.org/x/tools/cmd/goimports \
&& rm -rf /go/src /go/pkg
RUN curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.15.0
RUN /go/src/github.com/rancher/system-upgrade-controller/scripts/entry validate
FROM scratch
COPY --from=build /go/src/github.com/rancher/system-upgrade-controller/bin/ /bin/
ENTRYPOINT ["/bin/system-upgrade-controller"]