forked from astral-sh/python-build-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cross.Dockerfile
69 lines (62 loc) · 1.83 KB
/
build.cross.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
# Debian Stretch.
FROM debian@sha256:cebe6e1c30384958d471467e231f740e8f0fd92cbfd2a435a186e9bada3aee1c
MAINTAINER Gregory Szorc <gregory.szorc@gmail.com>
RUN groupadd -g 1000 build && \
useradd -u 1000 -g 1000 -d /build -s /bin/bash -m build && \
mkdir /tools && \
chown -R build:build /build /tools
ENV HOME=/build \
SHELL=/bin/bash \
USER=build \
LOGNAME=build \
HOSTNAME=builder \
DEBIAN_FRONTEND=noninteractive
CMD ["/bin/bash", "--login"]
WORKDIR '/build'
# Stretch stopped publishing snapshots in April 2023. Last snapshot
# is 20230423T032533Z. But there are package authentication issues
# with this snapshot.
RUN for s in debian_stretch debian_stretch-updates debian-security_stretch/updates; do \
echo "deb http://snapshot.debian.org/archive/${s%_*}/20221105T150728Z/ ${s#*_} main"; \
done > /etc/apt/sources.list && \
( echo 'quiet "true";'; \
echo 'APT::Get::Assume-Yes "true";'; \
echo 'APT::Install-Recommends "false";'; \
echo 'Acquire::Check-Valid-Until "false";'; \
echo 'Acquire::Retries "5";'; \
) > /etc/apt/apt.conf.d/99cpython-portable
RUN apt-get update
# Host building.
RUN apt-get install \
bzip2 \
gcc \
g++ \
libc6-dev \
libffi-dev \
make \
patch \
perl \
pkg-config \
tar \
xz-utils \
unzip \
zip \
zlib1g-dev
# Cross-building.
RUN apt-get install \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabi \
gcc-arm-linux-gnueabihf \
gcc-mips-linux-gnu \
gcc-mips64el-linux-gnuabi64 \
gcc-mipsel-linux-gnu \
gcc-powerpc64le-linux-gnu \
gcc-s390x-linux-gnu \
libc6-dev-arm64-cross \
libc6-dev-armel-cross \
libc6-dev-armhf-cross \
libc6-dev-mips-cross \
libc6-dev-mips64el-cross \
libc6-dev-mipsel-cross \
libc6-dev-ppc64el-cross \
libc6-dev-s390x-cross