]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/linux-tested-targets/Dockerfile
c47e5a9f43c92cb10ade67ccb999181565dfae0f
[rust.git] / src / ci / docker / linux-tested-targets / Dockerfile
1 FROM ubuntu:16.04
2
3 RUN apt-get update && apt-get install -y --no-install-recommends \
4   g++-multilib \
5   make \
6   file \
7   curl \
8   ca-certificates \
9   python2.7 \
10   git \
11   cmake \
12   xz-utils \
13   sudo \
14   gdb \
15   patch \
16   libssl-dev \
17   pkg-config
18
19 WORKDIR /build/
20 COPY musl-libunwind-patch.patch build-musl.sh /build/
21 RUN sh /build/build-musl.sh && rm -rf /build
22
23 RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
24     dpkg -i dumb-init_*.deb && \
25     rm dumb-init_*.deb
26 ENTRYPOINT ["/usr/bin/dumb-init", "--"]
27
28 ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
29 RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
30       tar xJf - -C /usr/local/bin --strip-components=1
31
32 ENV RUST_CONFIGURE_ARGS \
33       --target=x86_64-unknown-linux-musl,i686-unknown-linux-musl,i586-unknown-linux-gnu \
34       --musl-root-x86_64=/musl-x86_64 \
35       --musl-root-i686=/musl-i686
36
37 # Newer binutils broke things on some vms/distros (i.e., linking against
38 # unknown relocs disabled by the following flag), so we need to go out of our
39 # way to produce "super compatible" binaries.
40 #
41 # See: https://github.com/rust-lang/rust/issues/34978
42 ENV CFLAGS_i686_unknown_linux_gnu=-Wa,-mrelax-relocations=no \
43     CFLAGS_x86_64_unknown_linux_gnu=-Wa,-mrelax-relocations=no
44
45 ENV SCRIPT \
46       python2.7 ../x.py test \
47           --target x86_64-unknown-linux-musl \
48           --target i686-unknown-linux-musl \
49           --target i586-unknown-linux-gnu \
50           && \
51       python2.7 ../x.py dist \
52           --target x86_64-unknown-linux-musl \
53           --target i686-unknown-linux-musl \
54           --target i586-unknown-linux-gnu