forked from sebadob/rauthy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_builder
72 lines (53 loc) · 1.76 KB
/
Dockerfile_builder
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
ARG IMAGE
FROM $IMAGE AS openssl
ENV DEBIAN_FRONTEND=noninteractive
ENV LD_LIBRARY_PATH="${PATH}:/usr/local/lib64"
ENV PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig"
ENV MAKEFLAGS="-j32"
WORKDIR /root
RUN <<EOF
set -e
apt update
apt install -y build-essential checkinstall curl zlib1g-dev vim
rm -rf /var/lib/apt/lists/*
curl -LO https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz
tar xvf openssl-3.3.2.tar.gz
cd openssl-3.3.2
./config
make
make test
make install
echo '/usr/local/lib64' > /etc/ld.so.conf.d/lib64.conf
ldconfig
cd ..
rm -rf openssl*
EOF
############################################
############################################
FROM $IMAGE
ENV DEBIAN_FRONTEND=noninteractive
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
ENV LD_LIBRARY_PATH="${PATH}:/usr/local/lib64"
ENV PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig"
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
RUN <<EOF
#!/bin/bash
set -e
rustup target add aarch64-unknown-linux-gnu
rustup component add rustfmt
apt update
apt install -y clang gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
apt-get clean
EOF
COPY --from=openssl /etc/ld.so.conf.d/lib64.conf /etc/ld.so.conf.d/lib64.conf
COPY --from=openssl /usr/local/lib64 /usr/local/lib64
COPY --from=openssl /usr/local/include/openssl /usr/local/include/openssl
COPY --from=openssl /usr/local/bin/openssl /usr/local/bin/openssl
COPY --from=openssl /usr/local/bin/c_rehash /usr/local/bin/c_rehash
COPY --from=openssl /usr/local/ssl /usr/local/ssl
COPY --from=openssl /usr/local/share/man /usr/local/share/man
COPY --from=openssl /usr/local/share/doc/openssl /usr/local/share/doc/openssl
RUN ldconfig
WORKDIR /work
CMD ["/bin/bash"]