2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-01 19:32:32 +00:00
restic/vendor/golang.org/x/sys/unix/linux/Dockerfile

53 lines
2.0 KiB
Docker
Raw Normal View History

FROM ubuntu:17.10
2017-09-13 12:09:48 +00:00
2017-07-23 12:24:45 +00:00
# Dependencies to get the git sources and go binaries
2018-05-07 20:47:39 +00:00
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
2017-07-23 12:24:45 +00:00
curl \
git \
2018-05-07 20:47:39 +00:00
&& apt-get clean \
2017-07-23 12:24:45 +00:00
&& 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
2018-05-07 20:47:39 +00:00
# Linux Kernel: Released 01 Apr 2018
RUN git clone --branch v4.16 --depth 1 https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
# GNU C library: Released 01 Feb 2018 (we should try to get a secure way to clone this)
RUN git clone --branch glibc-2.27 --depth 1 git://sourceware.org/git/glibc.git
2017-07-23 12:24:45 +00:00
2018-05-07 20:47:39 +00:00
# Get Go
ENV GOLANG_VERSION 1.10.1
2017-07-23 12:24:45 +00:00
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
2018-05-07 20:47:39 +00:00
ENV GOLANG_DOWNLOAD_SHA256 72d820dec546752e5a8303b33b009079c15c2390ce76d67cf514991646c6127b
2017-07-23 12:24:45 +00:00
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
2018-05-07 20:47:39 +00:00
# Linux and Glibc build dependencies and emulator
RUN apt-get update && apt-get install -y --no-install-recommends \
bison gawk make python \
2017-07-23 12:24:45 +00:00
gcc gcc-multilib \
gettext texinfo \
2018-05-07 20:47:39 +00:00
qemu \
&& apt-get clean \
2017-07-23 12:24:45 +00:00
&& rm -rf /var/lib/apt/lists/*
2018-05-07 20:47:39 +00:00
# Cross compilers (install recommended packages to get cross libc-dev)
2017-07-23 12:24:45 +00:00
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-powerpc64-linux-gnu gcc-powerpc64le-linux-gnu \
gcc-s390x-linux-gnu gcc-sparc64-linux-gnu \
2018-05-07 20:47:39 +00:00
&& apt-get clean \
2017-07-23 12:24:45 +00:00
&& rm -rf /var/lib/apt/lists/*
# Let the scripts know they are in the docker environment
ENV GOLANG_SYS_BUILD docker
WORKDIR /build
ENTRYPOINT ["go", "run", "linux/mkall.go", "/git/linux", "/git/glibc"]