github.com/cilium/cilium@v1.16.2/images/runtime/Dockerfile (about)

     1  # Copyright Authors of Cilium
     2  # SPDX-License-Identifier: Apache-2.0
     3  
     4  ARG TESTER_IMAGE=quay.io/cilium/image-tester:dd09c8d3ef349a909fbcdc99279516baef153f22@sha256:c056d064cb47c97acd607343db5457e1d49d9338d6d8a87e93e23cc93f052c73
     5  ARG GOLANG_IMAGE=docker.io/library/golang:1.22.7@sha256:4594271250150c1a322ed749abfd218e1a8c6eb1ade90872e325a664412e2037
     6  ARG UBUNTU_IMAGE=docker.io/library/ubuntu:22.04@sha256:adbb90115a21969d2fe6fa7f9af4253e16d45f8d4c1e930182610c4731962658
     7  
     8  ARG CILIUM_LLVM_IMAGE=quay.io/cilium/cilium-llvm:9f1bfe736009afb1fbb562718bbc42ea07d37d8e@sha256:a666a7a01a2dc610c3ab6e32f25ca5e294201f3cbbc01f233320c527955deee3
     9  ARG CILIUM_BPFTOOL_IMAGE=quay.io/cilium/cilium-bpftool:0db3a73729ceb42e947d826bb96a655be79e5317@sha256:de23c9546c4eafab33f75d6f5d129947bbbafc132dbd113c0cecc9a61929e6b0
    10  ARG CILIUM_IPTABLES_IMAGE=quay.io/cilium/iptables:67f517af50e18f64cd12625021f1c39246bb4f92@sha256:d075f03e89aacf51908346ec8ed5d251b8d3ad528ce30a710fcd074cdf91f11d
    11  
    12  FROM ${CILIUM_LLVM_IMAGE} AS llvm-dist
    13  FROM ${CILIUM_BPFTOOL_IMAGE} AS bpftool-dist
    14  FROM ${CILIUM_IPTABLES_IMAGE} AS iptables-dist
    15  
    16  FROM --platform=${BUILDPLATFORM} ${GOLANG_IMAGE} AS gops-cni-builder
    17  
    18  RUN apt-get update && apt-get install -y binutils-aarch64-linux-gnu binutils-x86-64-linux-gnu
    19  
    20  # build-gops.sh will build both archs at the same time
    21  WORKDIR /go/src/github.com/cilium/cilium/images/runtime
    22  RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/cilium/images/runtime --mount=target=/root/.cache,type=cache --mount=target=/go/pkg/mod,type=cache \
    23      ./build-gops.sh
    24  # download-cni.sh will build both archs at the same time
    25  RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/cilium/images/runtime --mount=target=/root/.cache,type=cache --mount=target=/go/pkg/mod,type=cache \
    26      ./download-cni.sh
    27  
    28  FROM ${UBUNTU_IMAGE} AS rootfs
    29  
    30  # Change the number to force the generation of a new git-tree SHA. Useful when
    31  # we want to re-run 'apt-get upgrade' for stale images.
    32  ENV FORCE_BUILD=3
    33  
    34  # Update ubuntu packages to the most recent versions
    35  RUN apt-get update && \
    36      apt-get upgrade -y && \
    37      apt-get install -y jq
    38  
    39  WORKDIR /go/src/github.com/cilium/cilium/images/runtime
    40  RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/cilium/images/runtime \
    41      ./install-runtime-deps.sh
    42  
    43  COPY --from=iptables-dist /iptables /iptables
    44  RUN dpkg -i /iptables/*\.deb && rm -rf /iptables
    45  
    46  RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/cilium/images/runtime \
    47      ./iptables-wrapper-installer.sh --no-sanity-check
    48  
    49  COPY --from=llvm-dist /usr/local/bin/clang /usr/local/bin/llc /usr/local/bin/
    50  COPY --from=bpftool-dist /usr/local /usr/local
    51  
    52  ARG TARGETPLATFORM
    53  COPY --from=gops-cni-builder /out/${TARGETPLATFORM}/bin/loopback /cni/loopback
    54  COPY --from=gops-cni-builder /out/${TARGETPLATFORM}/bin/gops /bin/gops
    55  
    56  FROM ${TESTER_IMAGE} AS test
    57  COPY --from=rootfs / /
    58  COPY --from=llvm-dist /test /test
    59  COPY --from=bpftool-dist /test /test
    60  RUN /test/bin/cst -C /test/llvm
    61  RUN /test/bin/cst -C /test/bpftool
    62  
    63  FROM scratch
    64  LABEL maintainer="maintainer@cilium.io"
    65  COPY --from=rootfs / /