forked from lovell/sharp-libvips
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (59 loc) · 1.57 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
FROM debian:bullseye
LABEL maintainer="Lovell Fuller <npm@lovell.info>"
# Create Debian-based container suitable for cross-compiling Linux ARM64v8-A binaries
# Path settings
ENV \
RUSTUP_HOME="/usr/local/rustup" \
CARGO_HOME="/usr/local/cargo" \
PATH="/usr/local/cargo/bin:$PATH"
# Build dependencies
RUN \
apt-get update && \
apt-get install -y curl && \
dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install -y \
advancecomp \
autoconf \
autopoint \
brotli \
cmake \
crossbuild-essential-arm64 \
gettext \
git \
gobject-introspection \
gperf \
gtk-doc-tools \
intltool \
jq \
libglib2.0-dev \
libtool \
nasm \
ninja-build \
python3-pip \
texinfo \
&& \
curl https://sh.rustup.rs -sSf | sh -s -- -y \
--no-modify-path \
--profile minimal \
--default-toolchain nightly \
&& \
rustup component add rust-src && \
rustup target add aarch64-unknown-linux-gnu && \
pip3 install meson
# Rebuild the standard library of Rust to avoid collisions with system libraries.
# See: https://github.com/lovell/sharp-libvips/issues/109
RUN \
printf "[unstable]\n\
build-std = [\"std\", \"panic_abort\"]\n\
build-std-features = [\"panic_immediate_abort\"]" > $CARGO_HOME/config.toml
# Compiler settings
ENV \
PKG_CONFIG="/usr/bin/aarch64-linux-gnu-pkg-config" \
PLATFORM="linux-arm64v8" \
CHOST="aarch64-linux-gnu" \
RUST_TARGET="aarch64-unknown-linux-gnu" \
FLAGS="-march=armv8-a" \
MESON="--cross-file=/root/meson.ini"
COPY Toolchain.cmake /root/
COPY meson.ini /root/