mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
Mount the data volume for the Docker-based builder at x/sys instead of x/sys/unix. The x/sys/go.mod file was not included in the data volume when mounting x/sys/unix. This breaks module-aware go commands that run within the Docker container. Fix this problem by mounting the volume at x/sys and updating the working directory of the builder accordingly. Updates golang/go#49484 Change-Id: I2346b5320413b48de4984c9d9e31203941336357 Reviewed-on: https://go-review.googlesource.com/c/sys/+/363594 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Trust: Bryan C. Mills <bcmills@google.com>
58 lines
2.2 KiB
Docker
58 lines
2.2 KiB
Docker
FROM ubuntu:20.04
|
|
|
|
# Disable interactive prompts on package installation
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
# Dependencies to get the git sources and go binaries
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
git \
|
|
rsync \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Get the git sources. If not cached, this takes O(5 minutes).
|
|
WORKDIR /git
|
|
RUN git config --global advice.detachedHead false
|
|
# Linux Kernel: Released 31 Oct 2021
|
|
RUN git clone --branch v5.15 --depth 1 https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
|
|
# GNU C library: Released 02 Aug 2021
|
|
RUN git clone --branch release/2.34/master --depth 1 https://sourceware.org/git/glibc.git
|
|
|
|
# Get Go
|
|
ENV GOLANG_VERSION 1.17.3
|
|
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
|
|
ENV GOLANG_DOWNLOAD_SHA256 550f9845451c0c94be679faf116291e7807a8d78b43149f9506c1b15eb89008c
|
|
|
|
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
|
|
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
|
|
&& tar -C /usr/local -xzf golang.tar.gz \
|
|
&& rm golang.tar.gz
|
|
|
|
ENV PATH /usr/local/go/bin:$PATH
|
|
|
|
# Linux and Glibc build dependencies and emulator
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
bison gawk make python3 \
|
|
gcc gcc-multilib \
|
|
gettext texinfo \
|
|
qemu-user \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
# Cross compilers (install recommended packages to get cross libc-dev)
|
|
RUN apt-get update && apt-get install -y \
|
|
gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi \
|
|
gcc-mips-linux-gnu gcc-mips64-linux-gnuabi64 \
|
|
gcc-mips64el-linux-gnuabi64 gcc-mipsel-linux-gnu \
|
|
gcc-powerpc-linux-gnu gcc-powerpc64-linux-gnu \
|
|
gcc-powerpc64le-linux-gnu gcc-riscv64-linux-gnu \
|
|
gcc-s390x-linux-gnu gcc-sparc64-linux-gnu \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Let the scripts know they are in the docker environment
|
|
ENV GOLANG_SYS_BUILD docker
|
|
WORKDIR /build/unix
|
|
ENTRYPOINT ["go", "run", "linux/mkall.go", "/git/linux", "/git/glibc"]
|