1+ # Debian trixie base image
2+ FROM debian:trixie
3+
4+ # Avoid interactive prompts during apt operations
5+ ENV DEBIAN_FRONTEND=noninteractive
6+
7+ COPY base-packages.txt /tmp/base-packages.txt
8+
9+ RUN apt-get update && \
10+ apt-get install -y $(cat /tmp/base-packages.txt | tr '\n' ' ') && \
11+ apt-get clean && \
12+ rm -rf /var/lib/apt/lists/*
13+
14+ # Force sbuild to use the schroot backend.
15+ # sbuild-createchroot is for schroot-managed chroots; this avoids the "unshare" warning.
16+ RUN mkdir -p /root/.config/sbuild && \
17+ printf '%s\n' \
18+ '$chroot_mode = "schroot";' \
19+ '$schroot = "schroot";' \
20+ > /root/.config/sbuild/config.pl
21+
22+ # Create a Debian trixie sbuild chroot and prepare it for cross-building to arm64.
23+ RUN set -eux; \
24+ # Create the chroot from Debian mirrors (NOT Ubuntu) with Debian components.
25+ sbuild-createchroot \
26+ --arch=amd64 \
27+ --components=main,contrib,non-free,non-free-firmware \
28+ trixie /srv/chroot/trixie http://deb.debian.org/debian; \
29+ \
30+ # Configure the chroot's apt sources + enable multi-arch + install cross toolchain.
31+ chroot /srv/chroot/trixie /bin/bash -lc '\
32+ set -eux; \
33+ # Minimal, correct sources for Debian trixie. Add contrib/non-free only if needed.
34+ printf "%s\n" \
35+ "deb http://deb.debian.org/debian trixie main" \
36+ "# deb http://deb.debian.org/debian trixie contrib non-free non-free-firmware" \
37+ > /etc/apt/sources.list; \
38+ \
39+ # Enable arm64 multi-arch so sbuild can satisfy Build-Depends for the host arch.
40+ dpkg --add-architecture arm64; \
41+ apt-get update; \
42+ apt-get -y upgrade; \
43+ \
44+ # Cross toolchain for arm64 + a small baseline of arm64 libs.
45+ # sbuild will install package-specific B-Ds later (often :arm64 automatically).
46+ apt-get install -y --no-install-recommends \
47+ crossbuild-essential-arm64 \
48+ pkg-config \
49+ libc6:arm64 libc6-dev:arm64 linux-libc-dev:arm64 \
50+ libstdc++6:arm64 \
51+ lintian:amd64; \
52+ \
53+ # Keep the chroot lean
54+ apt-get clean; rm -rf /var/lib/apt/lists/* \
55+ '
56+
57+ # Workspace for mounting sources/outputs (your script already bind-mounts /workspace)
58+ WORKDIR /workspace
59+
60+ # Default shell
61+ CMD ["bash"]
0 commit comments