forked from harvester/harvester
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dapper
84 lines (73 loc) · 2.84 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
FROM quay.io/costoolkit/releases-green:luet-toolchain-0.21.2 as luet
FROM quay.io/costoolkit/releases-green:luet-makeiso-toolchain-0.4.0 as makeiso
FROM golang:1.18.3-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 \
squashfs-tools \
xorriso \
jq \
mtools \
dosfstools \
&& rm -rf /var/lib/apt/lists/*
# install yq
RUN GO111MODULE=on go install github.com/mikefarah/yq/[email protected]
# set up helm
ENV HELM_VERSION v3.5.4
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 -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.49.0; \
fi
## install controller-gen
RUN if [ "${ARCH}" = "amd64" ]; then \
GO111MODULE=on go install sigs.k8s.io/controller-tools/cmd/[email protected]; \
fi
## install ginkgo
RUN if [ "${ARCH}" = "amd64" ]; then \
GO111MODULE=on go install github.com/onsi/ginkgo/v2/[email protected]; \
fi
# install openapi-gen
RUN GO111MODULE=on go install k8s.io/code-generator/cmd/[email protected]
# install kind
RUN curl -Lo /usr/bin/kind https://kind.sigs.k8s.io/dl/v0.14.0/kind-linux-amd64 && chmod +x /usr/bin/kind
# install codecov
RUN curl -Lo /usr/bin/codecov https://uploader.codecov.io/latest/linux/codecov && chmod +x /usr/bin/codecov
# luet & makeiso
COPY --from=luet /usr/bin/luet /usr/bin/luet
COPY --from=makeiso /usr/bin/luet-makeiso /usr/bin/luet-makeiso
# -- 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 DRONE_BRANCH CROSS GOPROXY PUSH RKE2_IMAGE_REPO CODECOV_TOKEN
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"]