3 # Disable interactive prompts on package installation
4 ENV DEBIAN_FRONTEND noninteractive
6 # Dependencies to get the git sources and go binaries
7 RUN apt-get update && apt-get install -y --no-install-recommends \
13 && rm -rf /var/lib/apt/lists/*
15 # Get the git sources. If not cached, this takes O(5 minutes).
17 RUN git config --global advice.detachedHead false
18 # Linux Kernel: Released 13 Dec 2020
19 RUN git clone --branch v5.10 --depth 1 https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
20 # GNU C library: Released 06 Aug 2020 (we should try to get a secure way to clone this)
21 RUN git clone --branch release/2.32/master --depth 1 git://sourceware.org/git/glibc.git
24 ENV GOLANG_VERSION 1.16beta1
25 ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
26 ENV GOLANG_DOWNLOAD_SHA256 3931a0d493d411d6c697df6f15d5292fdd8031fde7014fded399effdad4c12d8
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 \
33 ENV PATH /usr/local/go/bin:$PATH
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 \
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-powerpc64-linux-gnu gcc-powerpc64le-linux-gnu \
49 gcc-riscv64-linux-gnu \
50 gcc-s390x-linux-gnu gcc-sparc64-linux-gnu \
52 && rm -rf /var/lib/apt/lists/*
54 # Let the scripts know they are in the docker environment
55 ENV GOLANG_SYS_BUILD docker
57 ENTRYPOINT ["go", "run", "linux/mkall.go", "/git/linux", "/git/glibc"]