-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathDockerfile.dapper
43 lines (41 loc) · 1.52 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
FROM registry.suse.com/bci/golang:1.23
# confirm that suse bci golang version upgraded to 1.20.10 after 2023-11-14
ARG PROXY
ARG GOPROXY
ARG ARCH=amd64
RUN zypper -n install netcat wget curl gawk git make
RUN zypper install -y -f docker
## install golangci-lint
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
export HTTPS_PROXY=${PROXY}; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.61.0; \
golangci-lint --version; \
fi
## install mockgen
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
go install github.com/golang/mock/[email protected]; \
mockgen --version; \
fi
## install ginkgo
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
go install github.com/onsi/ginkgo/v2/[email protected]; \
ginkgo version; \
fi
## install upx
ENV UPX_VERSION 4.2.1
RUN export HTTPS_PROXY=${PROXY}; \
curl -sL https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${ARCH}_linux.tar.xz | tar xvJf - --strip-components=1 -C /tmp && \
mv /tmp/upx /usr/bin/
# -- for make rules
# -- for dapper
ENV DAPPER_RUN_ARGS --privileged --network host -v autok3s-pkg:/go/pkg
ENV GO111MODULE=on
ENV AUTOK3S_DEV_MODE=true
ENV DAPPER_ENV CROSS DRONE_TAG REPO TAG OS ARCH IMAGE_NAME DIRTY_CHECK GOPROXY AUTOK3S_INSTALL_SCRIPT_SOURCE_REPO
ENV DAPPER_SOURCE /go/src/github.com/cnrancher/autok3s/
ENV DAPPER_OUTPUT ./bin ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}
# -- for dapper
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["hack/make-rules/autok3s.sh"]