-
Notifications
You must be signed in to change notification settings - Fork 55
/
Dockerfile.builder.tests
53 lines (50 loc) · 2.35 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
53
#
# 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-17 main" && \
apt-get update && \
apt-get install -y --no-install-recommends \
clang-17 clang-tools-17 llvm-17-dev lldb-17 lld-17 clang-format-17 libc++-17-dev libc++abi-17-dev && \
apt-get purge --auto-remove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#
# Install Bazelisk
#
# renovate: datasource=datasource depName=bazelbuild/bazelisk
ENV BAZELISK_VERSION=v1.20.0
RUN ARCH=$TARGETARCH \
&& curl -sfL https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-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