forked from harvester/harvester
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dapper
69 lines (61 loc) · 2.31 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
63
64
65
66
67
68
69
FROM golang:1.16.4-buster
ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
xz-utils \
unzip \
netcat \
zstd \
&& rm -rf /var/lib/apt/lists/*
# install yq
RUN GO111MODULE=on go get github.com/mikefarah/yq/v4@v4.6.0
# set up helm
ENV HELM_VERSION v3.4.1
ENV HELM_URL=https://get.helm.sh/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz
RUN mkdir /usr/tmp && \
curl ${HELM_URL} | tar xvzf - --strip-components=1 -C /usr/tmp/ && \
mv /usr/tmp/helm /usr/bin/helm
# -- for make rules
## 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=5:20.10.* \
&& rm -rf /var/lib/apt/lists/*
## install golangci
RUN if [ "${ARCH}" = "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b "$(go env GOPATH)/bin" v1.27.0; \
fi
## install controller-gen
RUN if [ "${ARCH}" = "amd64" ]; then \
GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1; \
fi
## install ginkgo
RUN if [ "${ARCH}" = "amd64" ]; then \
GO111MODULE=on go get github.com/onsi/ginkgo/ginkgo@v1.14.0; \
fi
# install openapi-gen
RUN GO111MODULE=on go get k8s.io/code-generator/cmd/openapi-gen@v0.18.6
# install kind
RUN curl -Lo /usr/bin/kind https://kind.sigs.k8s.io/dl/v0.11.0/kind-linux-amd64 && chmod +x /usr/bin/kind
# -- for make rules
# -- for dapper
ENV DAPPER_RUN_ARGS --privileged --network host -v /run/containerd/containerd.sock:/run/containerd/containerd.sock
ENV GO111MODULE off
ENV DAPPER_ENV REPO TAG DRONE_TAG CROSS GOPROXY
ENV DAPPER_SOURCE /go/src/github.com/harvester/harvester/
ENV DAPPER_OUTPUT ./bin ./dist ./package
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}
# -- for dapper
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]