Containerfile.x64 (1403B)
1 # test/libc/glibc/Containerfile.x64 — produces a glibc x86_64 sysroot 2 # tarball on stdout. Pinned to Debian bookworm (glibc 2.36). 3 # 4 # Companion to ./Containerfile (aarch64). See that file for the 5 # design notes on what gets staged and why; arch-specific differences: 6 # - amd64/debian base 7 # - multi-arch dir x86_64-linux-gnu (/usr/lib + /usr/include + /lib) 8 # - runtime loader is /lib64/ld-linux-x86-64.so.2 (note /lib64, 9 # not /lib, unlike aarch64 + riscv64). 10 FROM docker.io/amd64/debian:bookworm-slim 11 12 RUN apt-get update \ 13 && apt-get install -y --no-install-recommends \ 14 libc6-dev \ 15 linux-libc-dev \ 16 && rm -rf /var/lib/apt/lists/* 17 18 RUN set -eux; \ 19 mkdir -p /sysroot/lib /sysroot/lib64 /sysroot/include; \ 20 cd /usr/lib/x86_64-linux-gnu; \ 21 cp Scrt1.o crti.o crtn.o libc_nonshared.a /sysroot/lib/; \ 22 cp -L /lib/x86_64-linux-gnu/libc.so.6 /sysroot/lib/libc.so.6; \ 23 cp -L /lib/x86_64-linux-gnu/libm.so.6 /sysroot/lib/libm.so.6; \ 24 cp -L /lib64/ld-linux-x86-64.so.2 /sysroot/lib64/ld-linux-x86-64.so.2; \ 25 cp -r /usr/include/. /sysroot/include/ 26 27 RUN set -eux; \ 28 { \ 29 echo "debian bookworm-slim glibc $(dpkg-query -W -f='${Version}' libc6-dev)"; \ 30 echo "linux-libc-dev $(dpkg-query -W -f='${Version}' linux-libc-dev)"; \ 31 uname -m; \ 32 } > /sysroot/PROVENANCE 33 34 ENTRYPOINT ["sh", "-c", "tar -C /sysroot -cf - ."]