|
1 | | -ARG BASE_IMAGE=docker.io/kindest/node:v1.35.0@sha256:452d707d4862f52530247495d180205e029056831160e22870e37e3f6c1ac31f |
2 | | -ARG CNI_PLUGINS_VERSION=v1.9.0 |
3 | | -ARG HELM_VERSION=v4.0.4 |
4 | | -ARG FLANNEL_VERSION=v0.27.4 |
| 1 | +ARG BASE_IMAGE=docker.io/kindest/node:v1.33.0@sha256:91e9ed777db80279c22d1d1068c091b899b2078506e4a0f797fbf6e397c0b0b2 |
| 2 | +ARG CNI_PLUGINS_VERSION=v1.7.1 |
| 3 | +ARG HELM_VERSION=v3.17.3 |
| 4 | +ARG FLANNEL_VERSION=v0.26.7 |
| 5 | +ARG CALICO_VERSION=v3.30.5 |
5 | 6 | FROM ${BASE_IMAGE} |
6 | 7 | COPY Dockerfile.d/SHA256SUMS.d/ /tmp/SHA256SUMS.d |
7 | 8 | ARG CNI_PLUGINS_VERSION |
8 | 9 | ARG HELM_VERSION |
9 | 10 | ARG FLANNEL_VERSION |
10 | | -# This are private on our cluster and need to be copied to here |
11 | | -COPY cspca.llnl.gov.cer.pem /usr/local/share/ca-certificates/ |
12 | | -COPY cspca.cer.pem /usr/local/share/ca-certificates/ |
| 11 | +ARG CALICO_VERSION |
13 | 12 | RUN update-ca-certificates |
14 | 13 | RUN arch="$(uname -m | sed -e s/x86_64/amd64/ -e s/aarch64/arm64/)" && \ |
| 14 | + # CNI Plugins |
15 | 15 | fname="cni-plugins-linux-${arch}-${CNI_PLUGINS_VERSION}.tgz" && \ |
16 | | - curl --insecure -o "${fname}" -fSL "https://github.com/containernetworking/plugins/releases/download/${CNI_PLUGINS_VERSION}/${fname}" && \ |
| 16 | + curl -o "${fname}" -fSL "https://github.com/containernetworking/plugins/releases/download/${CNI_PLUGINS_VERSION}/${fname}" && \ |
17 | 17 | grep "${fname}" "/tmp/SHA256SUMS.d/cni-plugins-${CNI_PLUGINS_VERSION}" | sha256sum -c && \ |
18 | 18 | mkdir -p /opt/cni/bin && \ |
19 | 19 | tar xzf "${fname}" -C /opt/cni/bin && \ |
20 | 20 | rm -f "${fname}" && \ |
| 21 | + # Helm |
21 | 22 | fname="helm-${HELM_VERSION}-linux-${arch}.tar.gz" && \ |
22 | | - curl --insecure -o "${fname}" -fSL "https://get.helm.sh/${fname}" && \ |
| 23 | + curl -o "${fname}" -fSL "https://get.helm.sh/${fname}" && \ |
23 | 24 | grep "${fname}" "/tmp/SHA256SUMS.d/helm-${HELM_VERSION}" | sha256sum -c && \ |
24 | 25 | tar xzf "${fname}" -C /usr/local/bin --strip-components=1 -- "linux-${arch}/helm" && \ |
25 | 26 | rm -f "${fname}" && \ |
| 27 | + # Flannel |
26 | 28 | fname="flannel.tgz" && \ |
27 | | - curl --insecure -o "${fname}" -fSL "https://github.com/flannel-io/flannel/releases/download/${FLANNEL_VERSION}/${fname}" && \ |
| 29 | + curl -o "${fname}" -fSL "https://github.com/flannel-io/flannel/releases/download/${FLANNEL_VERSION}/${fname}" && \ |
28 | 30 | grep "${fname}" "/tmp/SHA256SUMS.d/flannel-${FLANNEL_VERSION}" | sha256sum -c && \ |
29 | 31 | tar xzf "${fname}" -C / && \ |
30 | | - rm -f "${fname}" |
| 32 | + rm -f "${fname}" && \ |
| 33 | + # Calico (calicoctl) |
| 34 | + fname="calicoctl-linux-${arch}" && \ |
| 35 | + curl -o "${fname}" -fSL "https://github.com/projectcalico/calico/releases/download/${CALICO_VERSION}/${fname}" && \ |
| 36 | + grep "${fname}" "/tmp/SHA256SUMS.d/calico-${CALICO_VERSION}" | sha256sum -c && \ |
| 37 | + chmod +x "${fname}" && \ |
| 38 | + mv "${fname}" /usr/local/bin/calicoctl && \ |
| 39 | + # Calico manifest - derive v3.31 from v3.31.5 |
| 40 | + calico_branch="$(echo "${CALICO_VERSION}" | cut -d. -f1,2)" && \ |
| 41 | + fname="calico.yaml" && \ |
| 42 | + curl -o "/${fname}" -fSL "https://raw.githubusercontent.com/projectcalico/calico/refs/heads/release-${calico_branch}/manifests/calico.yaml" && \ |
| 43 | + grep "${fname}" "/tmp/SHA256SUMS.d/calico-manifest-${CALICO_VERSION}" | sha256sum -c |
| 44 | + |
31 | 45 | # gettext-base: for `envsubst` |
32 | 46 | # moreutils: for `sponge` |
33 | 47 | # socat: for `socat` (to silence "[WARNING FileExisting-socat]" from kubeadm) |
| 48 | +# ipset: for using calico and command line utils |
| 49 | +# yq: needed to install custom calico manifests |
34 | 50 | RUN apt-get update && apt-get install -y --no-install-recommends \ |
35 | 51 | gettext-base \ |
36 | 52 | moreutils \ |
37 | | - socat ipset wget |
38 | | -ADD Dockerfile.d/etc_udev_rules.d_90-flannel.rules /etc/udev/rules.d/90-flannel.rules |
39 | | -ADD Dockerfile.d/etc_udev_rules.d_95-calico.rules /etc/udev/rules.d/95-calico.rules |
40 | | -ADD Dockerfile.d/u7s-entrypoint.sh / |
| 53 | + socat \ |
| 54 | + ipset \ |
| 55 | + yq \ |
| 56 | + && rm -rf /var/lib/apt/lists/* |
41 | 57 | # Calico |
42 | 58 | ENV FELIX_IGNORELOOSERPF=true |
43 | | -RUN wget https://github.com/projectcalico/calico/releases/download/v3.30.5/calicoctl-linux-amd64 -O /tmp/calicoctl && \ |
44 | | - chmod +x /tmp/calicoctl && mv /tmp/calicoctl /usr/local/bin |
| 59 | +ADD Dockerfile.d/etc_udev_rules.d_90-flannel-calico.rules /etc/udev/rules.d/90-flannel-calico.rules |
| 60 | +ADD Dockerfile.d/u7s-entrypoint.sh / |
45 | 61 | ENTRYPOINT ["/u7s-entrypoint.sh", "/usr/local/bin/entrypoint", "/sbin/init"] |
0 commit comments