2016-10-11 21:21:40 +02:00
|
|
|
FROM ubuntu:16.04
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
2017-01-29 06:25:11 +01:00
|
|
|
automake \
|
|
|
|
bison \
|
|
|
|
bzip2 \
|
|
|
|
ca-certificates \
|
|
|
|
cmake \
|
|
|
|
curl \
|
|
|
|
file \
|
|
|
|
flex \
|
2016-10-11 21:21:40 +02:00
|
|
|
g++ \
|
2017-01-29 06:25:11 +01:00
|
|
|
gawk \
|
|
|
|
gdb \
|
|
|
|
git \
|
|
|
|
gperf \
|
|
|
|
help2man \
|
|
|
|
libncurses-dev \
|
|
|
|
libtool-bin \
|
2016-10-11 21:21:40 +02:00
|
|
|
make \
|
2017-01-29 06:25:11 +01:00
|
|
|
patch \
|
2016-10-11 21:21:40 +02:00
|
|
|
python2.7 \
|
|
|
|
sudo \
|
2017-01-29 06:25:11 +01:00
|
|
|
texinfo \
|
2017-01-13 18:18:09 +01:00
|
|
|
wget \
|
2017-02-10 21:59:40 +01:00
|
|
|
xz-utils \
|
|
|
|
libssl-dev \
|
|
|
|
pkg-config
|
2016-10-11 21:21:40 +02:00
|
|
|
|
2016-12-13 05:01:13 +01:00
|
|
|
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
|
|
|
|
dpkg -i dumb-init_*.deb && \
|
|
|
|
rm dumb-init_*.deb
|
|
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
|
|
|
|
2017-01-29 06:25:11 +01:00
|
|
|
# Ubuntu 16.04 (this contianer) ships with make 4, but something in the
|
|
|
|
# toolchains we build below chokes on that, so go back to make 3
|
|
|
|
RUN curl https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf - && \
|
|
|
|
cd make-3.81 && \
|
|
|
|
./configure --prefix=/usr && \
|
|
|
|
make && \
|
|
|
|
make install && \
|
|
|
|
cd .. && \
|
|
|
|
rm -rf make-3.81
|
|
|
|
|
|
|
|
RUN curl http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.22.0.tar.bz2 | \
|
|
|
|
tar xjf - && \
|
|
|
|
cd crosstool-ng && \
|
|
|
|
./configure --prefix=/usr/local && \
|
|
|
|
make -j$(nproc) && \
|
|
|
|
make install && \
|
|
|
|
cd .. && \
|
|
|
|
rm -rf crosstool-ng
|
|
|
|
|
|
|
|
RUN groupadd -r rustbuild && useradd -m -r -g rustbuild rustbuild
|
|
|
|
RUN mkdir /x-tools && chown rustbuild:rustbuild /x-tools
|
|
|
|
USER rustbuild
|
|
|
|
WORKDIR /tmp
|
|
|
|
|
2017-05-12 20:18:34 +02:00
|
|
|
COPY dist-armhf-linux/arm-linux-gnueabihf.config dist-armhf-linux/build-toolchains.sh /tmp/
|
2017-04-01 16:18:43 +02:00
|
|
|
RUN ./build-toolchains.sh
|
2017-01-29 06:25:11 +01:00
|
|
|
|
2017-03-17 20:52:44 +01:00
|
|
|
USER root
|
|
|
|
|
2017-03-22 19:33:07 +01:00
|
|
|
RUN curl -o /usr/local/bin/sccache \
|
2017-05-12 18:07:10 +02:00
|
|
|
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-unknown-linux-musl && \
|
2017-03-22 19:33:07 +01:00
|
|
|
chmod +x /usr/local/bin/sccache
|
|
|
|
|
2017-04-01 16:18:43 +02:00
|
|
|
ENV PATH=$PATH:/x-tools/arm-unknown-linux-gnueabihf/bin
|
2016-12-12 20:36:52 +01:00
|
|
|
|
2017-04-01 16:18:43 +02:00
|
|
|
ENV CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc \
|
|
|
|
AR_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-ar \
|
|
|
|
CXX_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-g++
|
2016-10-11 21:21:40 +02:00
|
|
|
|
2017-04-01 16:18:43 +02:00
|
|
|
ENV HOSTS=arm-unknown-linux-gnueabihf
|
2017-01-16 23:15:12 +01:00
|
|
|
|
2017-01-21 02:03:06 +01:00
|
|
|
ENV RUST_CONFIGURE_ARGS --host=$HOSTS --enable-extended
|
2017-01-16 23:15:12 +01:00
|
|
|
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
|