Skip to content

Instantly share code, notes, and snippets.

@pragmatrix
Created July 8, 2025 16:12
Show Gist options
  • Save pragmatrix/eabe29d21d1ab327ac148157d59ebdc3 to your computer and use it in GitHub Desktop.
Save pragmatrix/eabe29d21d1ab327ac148157d59ebdc3 to your computer and use it in GitHub Desktop.
archlinux rust-skia Dockerfile
FROM --platform=linux/amd64 archlinux:latest
ENV RUSTFLAGS="-C target-feature=-crt-static" \
CC="clang" \
CXX="clang++" \
GN_EXE="gn" \
SKIA_GN_COMMAND="/usr/bin/gn" \
SKIA_NINJA_COMMAND="/usr/bin/ninja"
RUN pacman -Syu --noconfirm \
curl git python clang llvm \
musl openssl gcc make \
fontconfig ttf-dejavu \
gn ninja
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
ENV PATH="/root/.cargo/bin:${PATH}"
# fake the <asm/hwcap.h> include used by "skia/third_party/externals/zlib/cpu_features.c"
# which doesn't exist on aarch64-archlinux but is requested anyway due to an `ifdef ARMV8_OS_LINUX`
# RUN mkdir -p /usr/include/c++/10.3.1/aarch64-unknown-linux-gnu/asm && \
# touch /usr/include/c++/10.3.1/aarch64-unknown-linux-gnu/asm/hwcap.h
WORKDIR /code
COPY . /code/rust-skia/
RUN cd rust-skia && \
cargo build -vv -p skia-safe --features=embed-freetype,textlayout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment