Dockerfile 2.1 KB

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