github.com/Andyfoo/golang/x/sys@v0.0.0-20190901054642-57c1bf301704/unix/linux/Dockerfile (about)

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