Skip to content

Commit 7726bf7

Browse files
committed
Remove bootstrap and do it by hand
1 parent 522bcb9 commit 7726bf7

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

Dockerfile

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ ARG GCC_VERSION=15.2.0 \
99
BINUTILS_VERSION=2.42 \
1010
GBLIC_VERSION=2.39
1111

12+
COPY ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources
13+
1214
RUN set -ex ;\
15+
dpkg --add-architecture armhf ;\
16+
dpkg --add-architecture arm64 ;\
1317
apt update ;\
1418
apt upgrade -y ;\
1519
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
1620
curl ca-certificates tzdata build-essential gcc-multilib \
17-
file flex bison texinfo libc6-dev-i386 debootstrap \
21+
file flex bison texinfo libc6-dev-i386 \
1822
;\
23+
echo 'APT::Sandbox::User "root";' > /etc/apt/apt.conf.d/10sandbox ;\
24+
\
1925
cd /tmp ;\
2026
curl -fL https://ftpmirror.gnu.org/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz -o gcc.tar.xz ;\
2127
curl -fL https://ftpmirror.gnu.org/gnu/binutils/binutils-$BINUTILS_VERSION.tar.xz -o binutils.tar.xz
@@ -44,7 +50,15 @@ RUN set -ex ;\
4450
# update-alternatives --install /usr/bin/g++ g++ /opt/x86_64-linux-gnu/bin/x86_64-linux-gnu-g++ 100
4551

4652
RUN set -ex ;\
47-
debootstrap --include libc6-dev --arch arm64 --variant minbase --no-check-gpg noble /opt/arm64-sysroot ;\
53+
mkdir -p /opt/arm64-sysroot ;\
54+
cd /opt/arm64-sysroot ;\
55+
apt-get download libc6-dev:arm64 libc6:arm64 linux-libc-dev:arm64 ;\
56+
for pkg in *.deb; do \
57+
dpkg-deb -x $pkg /opt/arm64-sysroot ;\
58+
done ;\
59+
{ rm -f *.deb || true; }; \
60+
ln -s /opt/arm64-sysroot/usr/lib /opt/arm64-sysroot/lib ;\
61+
\
4862
mkdir -p /usr/src/binutils/build ;\
4963
tar -xf /tmp/binutils.tar.xz -C /usr/src/binutils --strip-components=1 ;\
5064
cd /usr/src/binutils/build ;\
@@ -60,6 +74,7 @@ RUN set -ex ;\
6074
;\
6175
make -j$(nproc) ;\
6276
make install-strip ;\
77+
\
6378
rm -rf /usr/src/gcc ;\
6479
mkdir -p /usr/src/gcc/build ;\
6580
tar -xf /tmp/gcc.tar.xz -C /usr/src/gcc --strip-components=1 ;\
@@ -83,7 +98,15 @@ RUN set -ex ;\
8398
make install-strip
8499

85100
RUN set -ex ;\
86-
debootstrap --include libc6-dev --arch armhf --variant minbase --no-check-gpg noble /opt/armhf-sysroot ;\
101+
mkdir -p /opt/armhf-sysroot ;\
102+
cd /opt/armhf-sysroot ;\
103+
apt-get download libc6-dev:armhf libc6:armhf linux-libc-dev:armhf ;\
104+
for pkg in *.deb; do \
105+
dpkg-deb -x $pkg /opt/armhf-sysroot ;\
106+
done ;\
107+
{ rm -f *.deb || true; }; \
108+
ln -s /opt/armhf-sysroot/usr/lib /opt/armhf-sysroot/lib ;\
109+
\
87110
rm -rf /usr/src/binutils ;\
88111
mkdir -p /usr/src/binutils/build ;\
89112
tar -xf /tmp/binutils.tar.xz -C /usr/src/binutils --strip-components=1 ;\
@@ -100,6 +123,7 @@ RUN set -ex ;\
100123
;\
101124
make -j$(nproc) ;\
102125
make install-strip ;\
126+
\
103127
rm -rf /usr/src/gcc ;\
104128
mkdir -p /usr/src/gcc/build ;\
105129
tar -xf /tmp/gcc.tar.xz -C /usr/src/gcc --strip-components=1 ;\

ubuntu.sources

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Types: deb
2+
URIs: http://archive.ubuntu.com/ubuntu/
3+
Suites: noble noble-updates noble-backports
4+
Components: main universe restricted multiverse
5+
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
6+
Architectures: amd64
7+
8+
Types: deb
9+
URIs: http://security.ubuntu.com/ubuntu/
10+
Suites: noble-security
11+
Components: main universe restricted multiverse
12+
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
13+
Architectures: amd64
14+
15+
Types: deb
16+
URIs: http://ports.ubuntu.com/ubuntu-ports
17+
Suites: noble noble-updates noble-backports
18+
Components: main universe restricted multiverse
19+
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
20+
Architectures: arm64 armhf

0 commit comments

Comments
 (0)