-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDockerfile.base
More file actions
106 lines (94 loc) · 3.42 KB
/
Dockerfile.base
File metadata and controls
106 lines (94 loc) · 3.42 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright 2026 LiveKit
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Build with (from docker/ directory):
# docker buildx build --platform linux/$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') -t livekit-cpp-sdk-base -f Dockerfile.base .
# Run with:
# docker run -it --network host livekit-cpp-sdk-base:latest bash
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV HOME=/root
# Install make, pkg-config, and base build deps (pkg-config + libglib2.0-dev for Rust glib-sys, libasound2-dev for alsa-sys)
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
libasound2-dev \
libabsl-dev \
libclang-dev \
libdrm-dev \
libglib2.0-dev \
libprotobuf-dev \
libdecor-0-dev \
libspdlog-dev \
libssl-dev \
libunwind-dev \
libusb-1.0-0-dev \
libva-dev \
libwayland-dev \
make \
ninja-build \
pkg-config \
protobuf-compiler \
wget \
llvm-dev \
clang \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
# Install GCC 14 first (slow; keep early for better layer caching)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
flex \
libgmp-dev \
libmpc-dev \
libmpfr-dev \
&& rm -rf /var/lib/apt/lists/*
RUN cd $HOME \
&& wget https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz \
&& tar xf gcc-14.2.0.tar.xz \
&& cd gcc-14.2.0 \
&& ./configure --prefix=$HOME/gcc-14 --enable-languages=c,c++ --disable-multilib --disable-bootstrap \
&& make -j$(nproc) \
&& make install \
&& cd $HOME \
&& rm -rf gcc-14.2.0 gcc-14.2.0.tar.xz
RUN mkdir -p /home/installs && cp -a $HOME/gcc-14/bin/* /home/installs/
ENV CC=$HOME/gcc-14/bin/gcc
ENV CXX=$HOME/gcc-14/bin/g++
ENV LD_LIBRARY_PATH=$HOME/gcc-14/lib64
# Install CMake 3.31.5 for current architecture (prefix dir must exist before installer runs)
# TARGETARCH is set by Docker BuildKit when building (amd64 -> x86_64, arm64 -> aarch64)
ARG TARGETARCH
RUN mkdir -p $HOME/cmake-3.31 \
&& CMAKE_ARCH=$(case "$TARGETARCH" in amd64) echo x86_64 ;; arm64) echo aarch64 ;; *) echo "$TARGETARCH" ;; esac) \
&& wget -q "https://github.com/Kitware/CMake/releases/download/v3.31.5/cmake-3.31.5-linux-${CMAKE_ARCH}.sh" \
-O cmake-installer.sh \
&& chmod +x cmake-installer.sh \
&& ./cmake-installer.sh --skip-license --prefix=$HOME/cmake-3.31 \
&& rm cmake-installer.sh
ENV PATH=$HOME/cmake-3.31/bin:$PATH
# Install Rust (non-interactive)
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& . $HOME/.cargo/env && rustup default stable
ENV PATH=$HOME/.cargo/bin:$PATH
# Deps for SDL (X11 + OpenGL/GLX for FindOpenGL)
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1-mesa-dev \
libx11-dev \
libxcursor-dev \
libxext-dev \
libxfixes-dev \
libxi-dev \
libxrandr-dev \
&& rm -rf /var/lib/apt/lists/*