-
Notifications
You must be signed in to change notification settings - Fork 75
/
Dockerfile.dapper
59 lines (48 loc) · 2.49 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
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 registry.suse.com/bci/golang:1.22
ARG http_proxy=$http_proxy
ARG https_proxy=$https_proxy
ARG no_proxy=$no_proxy
ENV http_proxy=$http_proxy
ENV https_proxy=$https_proxy
ENV no_proxy=$no_proxy
ARG HARVESTER_INSTALLER_OFFLINE_BUILD
ENV HARVESTER_INSTALLER_OFFLINE_BUILD=$HARVESTER_INSTALLER_OFFLINE_BUILD
ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
# mtools and dosfstools are requirements for luet-makeiso >= 0.4.0 to build hybrid ISO.
RUN zypper -n rm container-suseconnect && \
zypper -n install git curl docker gzip tar wget zstd squashfs xorriso awk jq mtools dosfstools unzip rsync patch
RUN curl -sfL https://github.com/mikefarah/yq/releases/download/v4.21.1/yq_linux_${ARCH} -o /usr/bin/yq && chmod +x /usr/bin/yq
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1
# only needed for raw image generation. currently skipped for arm builds
RUN if [ "${ARCH}" == "amd64" ]; then \
zypper addrepo http://download.opensuse.org/distribution/leap/15.4/repo/oss/ oss && \
zypper --gpg-auto-import-keys refresh && \
zypper in -y qemu-x86 qemu-tools; \
fi
RUN mkdir /grub2-mbr
COPY --from=grub2-mbr / /grub2-mbr
RUN mkdir /grub2-efi
COPY --from=grub2-efi / /grub2-efi
# set up helm
ENV HELM_VERSION v3.3.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
ARG LOCAL_HARVESTER_SRC
ENV HARVESTER_SRC_MOUNT="${LOCAL_HARVESTER_SRC:+-v $LOCAL_HARVESTER_SRC:/go/src/github.com/harvester/harvester}"
ARG LOCAL_ADDONS_SRC
ENV ADDONS_SRC_MOUNT="${LOCAL_ADDONS_SRC:+-v $LOCAL_ADDONS_SRC:/go/src/github.com/harvester/addons}"
# You cloud defined your own rke2 url by setup `RKE2_IMAGE_REPO`
ENV DAPPER_ENV REPO TAG DRONE_TAG DRONE_BRANCH CROSS RKE2_IMAGE_REPO USE_LOCAL_IMAGES BUILD_QCOW DRONE_BUILD_EVENT REMOTE_DEBUG
ENV DAPPER_SOURCE /go/src/github.com/harvester/harvester-installer/
ENV DAPPER_OUTPUT ./bin ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_RUN_ARGS "-v /run/containerd/containerd.sock:/run/containerd/containerd.sock -v harvester-installer-go:/root/go -v harvester-installer-cache:/root/.cache ${HARVESTER_SRC_MOUNT} ${ADDONS_SRC_MOUNT} --privileged"
ENV HOME ${DAPPER_SOURCE}
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]