forked from harvester/harvester
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dapper
83 lines (70 loc) · 2.69 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
FROM quay.io/costoolkit/releases-teal:grub2-live-0.0.4-2 as grub2-mbr
FROM quay.io/costoolkit/releases-teal:grub2-efi-image-live-0.0.4-2 as grub2-efi
FROM golang:1.20.10-bookworm
ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
xz-utils \
unzip \
zstd \
squashfs-tools \
xorriso \
jq \
mtools \
dosfstools \
patch \
&& 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 \
rsync \
&& 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 curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2
## install controller-gen
RUN GO111MODULE=on go install sigs.k8s.io/controller-tools/cmd/[email protected]
## install ginkgo
RUN GO111MODULE=on go install github.com/onsi/ginkgo/v2/[email protected]
# 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
# copy bootloaders
RUN mkdir /grub2-mbr
COPY --from=grub2-mbr / /grub2-mbr
RUN mkdir /grub2-efi
COPY --from=grub2-efi / /grub2-efi
# -- 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 USE_LOCAL_IMAGES CODECOV_TOKEN
ENV DAPPER_SOURCE /go/src/github.com/harvester/harvester/
ENV DAPPER_OUTPUT ./api ./bin ./deploy ./dist ./package ./pkg
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}
# -- for dapper
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]