-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.aarch64-static
43 lines (40 loc) · 1.63 KB
/
Dockerfile.aarch64-static
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
# WIP!!!
FROM rust:1-alpine3.17 AS musl
USER root
# Updating crates.io index
RUN cargo search --limit 0
# Installing dependencies
RUN apk add musl-dev pkgconfig curl tar openssl-dev perl make
WORKDIR /musl
# Cargo perm fix
RUN chmod a+X /root
# Convenience list of versions and variables for compilation later on
# This helps continuing manually if anything breaks.
ENV SSL_VER="1.1.1q" \
CURL_VER="7.85.0" \
ZLIB_VER="1.2.13" \
PQ_VER="11.12" \
SQLITE_VER="3390400" \
CC=/usr/bin/aarch64-linux-musl-gcc \
PREFIX=/musl \
PATH=/usr/local/bin:/root/.cargo/bin:$PATH \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig \
LD_LIBRARY_PATH=$PREFIX
# # Build zlib (used in openssl and pq)
# RUN curl -sSL https://zlib.net/zlib-$ZLIB_VER.tar.gz | tar xz && \
# cd zlib-$ZLIB_VER && \
# CC="${CC} -fPIC -pie" LDFLAGS="-L${PREFIX}/lib" CFLAGS="-I${PREFIX}/include" ./configure --static --prefix=$PREFIX && \
# make -j$(nproc) && make install && \
# cd .. && rm -rf zlib-$ZLIB_VER
# # Does not work #9 3.726 Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
# Build openssl (used in curl and pq)
# Would like to use zlib here, but can't seem to get it to work properly
# TODO: fix so that it works
RUN curl -sSL https://www.openssl.org/source/openssl-$SSL_VER.tar.gz | tar xz && \
cd openssl-$SSL_VER && \
./Configure no-zlib no-shared -fPIC --prefix=$PREFIX --openssldir=$PREFIX/ssl linux-aarch64 && \
# env C_INCLUDE_PATH=$PREFIX/include make depend 2> /dev/null && \
make -j$(nproc) && make install && \
cd .. && rm -rf openssl-$SSL_VER
FROM musl as chef
RUN cargo install cargo-chef