forked from cilium/proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.builder.tests
52 lines (50 loc) · 2.36 KB
/
Dockerfile.builder.tests
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
43
44
45
46
47
48
49
50
51
52
#
# Builder dependencies. This takes a long time to build from scratch!
# Also note that if build fails due to C++ internal error or similar,
# it is possible that the image build needs more RAM than available by
# default on non-Linux docker installs.
#
# This shoould be the same as Dockerfile.builder except the below:
# - Ubuntu version is bumped to 22.04
# - LLVM apt repo is from apt.llvm.org/jammy/ instead of apt.llvm.org/focal/
FROM docker.io/library/ubuntu:22.04@sha256:9a0bdde4188b896a372804be2384015e90e3f84906b750c1a53539b585fbbe7f as base
LABEL maintainer="[email protected]"
ARG TARGETARCH
# Setup TimeZone to prevent tzdata package asking for it interactively
ENV TZ=Etc/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
apt-get upgrade -y --no-install-recommends && \
apt-get install -y --no-install-recommends \
ca-certificates \
# Multi-arch cross-compilation packages
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 \
libc6-dev \
# Envoy Build dependencies
autoconf automake cmake coreutils curl git libtool make ninja-build patch patchelf \
python3 python-is-python3 unzip virtualenv wget zip \
# Cilium-envoy build dependencies
software-properties-common && \
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
apt-add-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" && \
apt-get update && \
apt-get install -y --no-install-recommends \
clang-15 clang-tools-15 lldb-15 lld-15 clang-format-15 libc++-15-dev libc++abi-15-dev && \
apt-get purge --auto-remove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#
# Install Bazel
#
COPY .bazelversion ./
RUN export BAZEL_VERSION=$(cat .bazelversion) \
&& ARCH=$TARGETARCH && [ "$ARCH" != "amd64" ] || ARCH="x86_64" \
&& curl -sfL https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-${ARCH} -o /usr/bin/bazel \
&& chmod +x /usr/bin/bazel
#
# Switch to non-root user for builds
#
RUN groupadd -f -g 1337 cilium && useradd -m -d /cilium/proxy -g cilium -u 1337 cilium
USER 1337:1337
WORKDIR /cilium/proxy