Debian Codegraph @

unix/linux/Dockerfile

raw
1 FROM ubuntu:25.04
2
3 # Disable interactive prompts on package installation
4 ENV DEBIAN_FRONTEND=noninteractive
5
6 # Dependencies to get the git sources and go binaries
7 RUN apt-get update && apt-get install -y --no-install-recommends \
8 ca-certificates \
9 curl \
10 git \
11 rsync \
12 && apt-get clean \
13 && rm -rf /var/lib/apt/lists/*
14
15 # Get the git sources. If not cached, this takes O(5 minutes).
16 WORKDIR /git
17 RUN git config --global advice.detachedHead false
18 # Linux Kernel: Released 13 Apr 2026
19 RUN git clone --branch v7.0 --depth 1 https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
20 # GNU C library: Released 29 Jan 2025
21 RUN git clone --branch release/2.41/master --depth 1 https://sourceware.org/git/glibc.git
22
23 # Get Go
24 ENV GOLANG_VERSION=1.25.1
25 ENV GOLANG_DOWNLOAD_URL=https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
26 ENV GOLANG_DOWNLOAD_SHA256=7716a0d940a0f6ae8e1f3b3f4f36299dc53e31b16840dbd171254312c41ca12e
27
28 RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
29 && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
30 && tar -C /usr/local -xzf golang.tar.gz \
31 && rm golang.tar.gz
32
33 ENV PATH=/usr/local/go/bin:$PATH
34
35 # Linux and Glibc build dependencies and emulator
36 RUN apt-get update && apt-get install -y --no-install-recommends \
37 bison gawk make python3 \
38 gcc gcc-multilib \
39 gettext texinfo \
40 qemu-user \
41 && apt-get clean \
42 && rm -rf /var/lib/apt/lists/*
43 # Cross compilers (install recommended packages to get cross libc-dev)
44 RUN apt-get update && apt-get install -y \
45 gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi \
46 gcc-mips-linux-gnu gcc-mips64-linux-gnuabi64 \
47 gcc-mips64el-linux-gnuabi64 gcc-mipsel-linux-gnu \
48 gcc-powerpc-linux-gnu gcc-powerpc64-linux-gnu \
49 gcc-powerpc64le-linux-gnu gcc-riscv64-linux-gnu \
50 gcc-s390x-linux-gnu gcc-sparc64-linux-gnu \
51 gcc-loongarch64-linux-gnu \
52 && apt-get clean \
53 && rm -rf /var/lib/apt/lists/*
54
55 # Let the scripts know they are in the docker environment
56 ENV GOLANG_SYS_BUILD=docker
57 WORKDIR /build/unix
58 ENTRYPOINT ["go", "run", "linux/mkall.go", "/git/linux", "/git/glibc"]