-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
73 lines (57 loc) · 2.32 KB
/
Dockerfile
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
# This container is based on ubuntu 18 because we need to link with libstdc++ 6.0.25 because of ABI incompatibilities.
# <https://github.com/rust-skia/rust-skia/issues/393>
FROM ubuntu:20.04
LABEL org.opencontainers.image.source https://github.com/pragmatrix/rust-skia-containers
# For github actions we need a newer git version
RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:git-core/ppa -y
RUN apt-get install -y wget
## Add llvm package repository for ubuntu 20 (focal))
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main"
# unzip: for installing the Android NDK
# libgl1 libgl1-mesa-dev mesa-common-dev: for builds that need OpenGL
# libgles2-mesa-dev for egl support.
# clang-16 / g++-16 is needed for more recent emscripten builds.
# make is needed for supplemental builds.
RUN apt-get update && apt-get install -y \
curl \
gcc \
g++-16 \
git \
libgl1 \
libgl1-mesa-dev \
libgles2-mesa-dev \
libssl-dev \
libfontconfig1-dev \
mesa-common-dev \
pkg-config \
python \
unzip \
make \
libwayland-dev
RUN update-alternatives \
--install /usr/bin/clang clang /usr/bin/clang-16 90 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-16 \
--slave /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-16 \
--slave /usr/bin/c++ c++ /usr/bin/clang++-16
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Install Android NDK
ENV ANDROID_NDK_VERSION=r26d
ENV ANDROID_HOST=linux-x86_64
# HTTP/1.1, because of spurious HTTP/2 framing errors in the Azure / GitHub cloud.
RUN curl --http1.1 -sSf -o android-ndk.zip https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux.zip \
&& unzip android-ndk.zip \
&& rm android-ndk.zip
ENV ANDROID_NDK=/android-ndk-${ANDROID_NDK_VERSION}
ENV PATH=${PATH}:/android-ndk-${ANDROID_NDK_VERSION}/toolchains/llvm/prebuilt/${ANDROID_HOST}/bin
# wasm32-unknown-emscripten
SHELL ["/bin/bash", "-c"]
ENV EMSCRIPTEN_VER=3.1.59
RUN git clone https://github.com/emscripten-core/emsdk.git \
&& (cd emsdk && ./emsdk install ${EMSCRIPTEN_VER}) \
&& (cd emsdk && ./emsdk activate ${EMSCRIPTEN_VER})
# Needed for cross compilation to aarch64-unknown-linux-gnu
RUN apt-get install -y g++-aarch64-linux-gnu