-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
42 lines (38 loc) · 1.69 KB
/
Dockerfile
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
# Download extra binaries needed by 'kubeasz'
# @author: gjmzj
# @repo: https://github.com/easzlab/dockerfile-kubeasz-ext-bin
# @ref: https://github.com/kubernetes/kubernetes/blob/master/build/dependencies.yaml
# build use golang:1.22
FROM golang:1.22 as builder
ENV CFSSL_VER=v1.6.5
RUN set -x \
&& mkdir -p /ext-bin \
&& git config --global advice.detachedHead false \
&& git clone --depth 1 -b ${CFSSL_VER} https://github.com/cloudflare/cfssl.git \
&& cd cfssl \
&& go build -tags 'netgo,osusergo,sqlite_omit_load_extension' -ldflags '-s -w -extldflags "-static"' cmd/cfssl/cfssl.go \
&& go build -tags 'netgo,osusergo,sqlite_omit_load_extension' -ldflags '-s -w -extldflags "-static"' cmd/cfssljson/cfssljson.go \
&& go build -tags 'netgo,osusergo,sqlite_omit_load_extension' -ldflags '-s -w -extldflags "-static"' cmd/cfssl-certinfo/cfssl-certinfo.go \
&& mv cfssljson cfssl-certinfo cfssl /ext-bin
# downloader use golang:1.22
FROM golang:1.22 as downloader
ENV CNI_VER=v1.6.2
ENV HELM_VER=v3.17.0
ENV CRICTL_VER=v1.32.0
ENV RUNC_VER=v1.2.4
ENV CONTAINERD_VER=2.0.2
ENV DOCKER_COMPOSE_VER=v2.32.4
ENV CALICOCTL_VER=v3.28.2
COPY multi-platform-download.sh .
RUN sh -x ./multi-platform-download.sh
# release image
FROM alpine:3.16
ENV EXT_BIN_VER=1.12.0
# https://github.com/etcd-io/etcd
COPY --from=quay.io/coreos/etcd:v3.5.16 /usr/local/bin/etcdctl /usr/local/bin/etcd /extra/
COPY --from=easzlab/kubeasz-ext-build:1.3.0 /ext-bin/* /extra/
COPY --from=builder /ext-bin/* /extra/
COPY --from=downloader /ext-bin/* /extra/
COPY --from=downloader /extra/containerd-bin/* /extra/containerd-bin/
COPY --from=downloader /extra/cni-bin/* /extra/cni-bin/
CMD [ "sleep", "360000000" ]