Dockerfile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. FROM ubuntu:19.04
  2. # Dependencies to get the git sources and go binaries
  3. RUN apt-get update && apt-get install -y --no-install-recommends \
  4. ca-certificates \
  5. curl \
  6. git \
  7. rsync \
  8. && apt-get clean \
  9. && rm -rf /var/lib/apt/lists/*
  10. # Get the git sources. If not cached, this takes O(5 minutes).
  11. WORKDIR /git
  12. RUN git config --global advice.detachedHead false
  13. # Linux Kernel: Released 15 Sep 2019
  14. RUN git clone --branch v5.3 --depth 1 https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
  15. # GNU C library: Released 02 Aug 2019 (we should try to get a secure way to clone this)
  16. RUN git clone --branch release/2.30/master --depth 1 git://sourceware.org/git/glibc.git
  17. # Get Go
  18. ENV GOLANG_VERSION 1.13
  19. ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
  20. ENV GOLANG_DOWNLOAD_SHA256 68a2297eb099d1a76097905a2ce334e3155004ec08cdea85f24527be3c48e856
  21. RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
  22. && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
  23. && tar -C /usr/local -xzf golang.tar.gz \
  24. && rm golang.tar.gz
  25. ENV PATH /usr/local/go/bin:$PATH
  26. # Linux and Glibc build dependencies and emulator
  27. RUN apt-get update && apt-get install -y --no-install-recommends \
  28. bison gawk make python3 \
  29. gcc gcc-multilib \
  30. gettext texinfo \
  31. qemu-user \
  32. && apt-get clean \
  33. && rm -rf /var/lib/apt/lists/*
  34. # Cross compilers (install recommended packages to get cross libc-dev)
  35. RUN apt-get update && apt-get install -y \
  36. gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi \
  37. gcc-mips-linux-gnu gcc-mips64-linux-gnuabi64 \
  38. gcc-mips64el-linux-gnuabi64 gcc-mipsel-linux-gnu \
  39. gcc-powerpc64-linux-gnu gcc-powerpc64le-linux-gnu \
  40. gcc-riscv64-linux-gnu \
  41. gcc-s390x-linux-gnu gcc-sparc64-linux-gnu \
  42. && apt-get clean \
  43. && rm -rf /var/lib/apt/lists/*
  44. # Let the scripts know they are in the docker environment
  45. ENV GOLANG_SYS_BUILD docker
  46. WORKDIR /build
  47. ENTRYPOINT ["go", "run", "linux/mkall.go", "/git/linux", "/git/glibc"]