Skip to content

Commit

Permalink
docker: Use golang image as proxylib builder
Browse files Browse the repository at this point in the history
This is to allow auto image update.

Signed-off-by: Tam Mach <tam.mach@cilium.io>
  • Loading branch information
sayboras committed Oct 26, 2023
1 parent 3caed3c commit 25c124f
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
#
ARG BUILDER_BASE=quay.io/cilium/cilium-envoy-builder:6.1.0-latest

# Common Builder image used in cilium/cilium
# We need gcc for cgo cross-compilation at least, we can swap to something smaller later on
ARG PROXYLIB_BUILDER=quay.io/cilium/cilium-builder:832f86bb0f7c7129c1536d5620174deeec645117@sha256:6dbac9f9eba3e20f8edad4676689aa8c11b172035fe5e25b533552f42dea4e9a
ARG PROXYLIB_BUILDER=docker.io/library/golang:1.21.3@sha256:24a09375a6216764a3eda6a25490a88ac178b5fcb9511d59d0da5ebf9e496474

#
# ARCHIVE_IMAGE defaults to the result of the first stage below,
Expand All @@ -22,6 +20,29 @@ FROM --platform=$BUILDPLATFORM $PROXYLIB_BUILDER as proxylib
WORKDIR /go/src/github.com/cilium/proxy
ARG TARGETARCH
ENV TARGETARCH=$TARGETARCH
RUN \
apt-get update && \
apt-get upgrade -y --no-install-recommends && \
apt-get install -y --no-install-recommends \
# Install cross tools for both arm64 on amd64
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
libc6-dev-arm64-cross \
binutils-aarch64-linux-gnu \
gcc-x86-64-linux-gnu \
g++-x86-64-linux-gnu \
libc6-dev-amd64-cross \
binutils-x86-64-linux-gnu \
binutils \
coreutils \
curl \
gcc \
git \
libc6-dev \
make && \
apt-get purge --auto-remove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/proxy --mount=mode=0777,target=/cilium/proxy/.cache,type=cache --mount=mode=0777,target=/go/pkg,type=cache \
GOARCH=${TARGETARCH} make -C proxylib all && mv proxylib/libcilium.so /tmp/libcilium.so

Expand Down

0 comments on commit 25c124f

Please sign in to comment.