github.com/cilium/cilium@v1.16.2/images/cilium-docker-plugin/Dockerfile (about)

     1  # Copyright Authors of Cilium
     2  # SPDX-License-Identifier: Apache-2.0
     3  
     4  ARG BASE_IMAGE=scratch
     5  ARG GOLANG_IMAGE=docker.io/library/golang:1.22.7@sha256:4594271250150c1a322ed749abfd218e1a8c6eb1ade90872e325a664412e2037
     6  
     7  # BUILDPLATFORM is an automatic platform ARG enabled by Docker BuildKit.
     8  # Represents the plataform where the build is happening, do not mix with
     9  # TARGETARCH
    10  FROM --platform=${BUILDPLATFORM} ${GOLANG_IMAGE} AS builder
    11  
    12  # TARGETOS is an automatic platform ARG enabled by Docker BuildKit.
    13  ARG TARGETOS
    14  # TARGETARCH is an automatic platform ARG enabled by Docker BuildKit.
    15  ARG TARGETARCH
    16  # MODIFIERS are extra arguments to be passed to make at build time.
    17  ARG MODIFIERS
    18  
    19  WORKDIR /go/src/github.com/cilium/cilium/plugins/cilium-docker
    20  RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/cilium --mount=target=/root/.cache,type=cache --mount=target=/go/pkg,type=cache \
    21      make GOARCH=${TARGETARCH} ${MODIFIERS} \
    22      && mkdir -p /out/${TARGETOS}/${TARGETARCH}/usr/bin && mv cilium-docker /out/${TARGETOS}/${TARGETARCH}/usr/bin
    23  
    24  FROM ${BASE_IMAGE} AS release
    25  # TARGETOS is an automatic platform ARG enabled by Docker BuildKit.
    26  ARG TARGETOS
    27  # TARGETARCH is an automatic platform ARG enabled by Docker BuildKit.
    28  ARG TARGETARCH
    29  LABEL maintainer="maintainer@cilium.io"
    30  COPY --from=builder /out/${TARGETOS}/${TARGETARCH}/usr/bin/cilium-docker /usr/bin/cilium-docker
    31  WORKDIR /
    32  CMD ["/usr/bin/cilium-docker"]