forked from cnrancher/autok3s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dapper
62 lines (56 loc) · 2.24 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
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM techknowlogick/xgo:base
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
xz-utils unzip netcat wget \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# -- for make rules
## install golang
RUN wget --no-check-certificate -O - https://golang.org/dl/go1.17.5.linux-amd64.tar.gz | tar -xz -C /usr/local
# Fix any stock package issues
RUN ln -s /usr/include/asm-generic /usr/include/asm && \
mkdir -p /go/src /go/bin && chmod -R 777 /go
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
## install docker client
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg \
&& rm -rf /var/lib/apt/lists/*; \
\
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - >/dev/null; \
echo "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/debian buster stable" > /etc/apt/sources.list.d/docker.list; \
\
apt-get update -qq && apt-get install -y --no-install-recommends \
docker-ce-cli=5:19.03.* \
&& rm -rf /var/lib/apt/lists/*; \
docker --version
## install golangci-lint
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.39.0; \
golangci-lint --version; \
fi
## install mockgen
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
GO111MODULE=on go get github.com/golang/mock/[email protected]; \
mockgen --version; \
fi
## install ginkgo
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
GO111MODULE=on go get github.com/onsi/ginkgo/[email protected]; \
ginkgo version; \
fi
# -- for make rules
# -- for dapper
ENV DAPPER_RUN_ARGS --privileged --network host
ENV GO111MODULE=on
ENV CROSS=false
ENV DAPPER_ENV CROSS CLUSTER_TYPE DOCKER_USERNAME DOCKER_PASSWORD WITHOUT_MANIFEST ONLY_MANIFEST IGNORE_MISSING DRONE_TAG REPO TAG OS ARCH IMAGE_NAME DIRTY_CHECK
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 ["make", "-se", "autok3s"]