]> git.lizzy.rs Git - rust.git/blob - src/ci/docker/dist-x86-linux/Dockerfile
Rollup merge of #40521 - TimNN:panic-free-shift, r=alexcrichton
[rust.git] / src / ci / docker / dist-x86-linux / Dockerfile
1 FROM centos:5
2
3 WORKDIR /build
4
5 RUN yum upgrade -y && yum install -y \
6       curl \
7       bzip2 \
8       gcc \
9       make \
10       glibc-devel \
11       perl \
12       zlib-devel \
13       file \
14       xz \
15       which \
16       pkgconfig \
17       wget \
18       autoconf \
19       gettext
20
21 ENV PATH=/rustroot/bin:$PATH
22 ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib
23 ENV PKG_CONFIG_PATH=/rustroot/lib/pkgconfig
24 WORKDIR /tmp
25 COPY shared.sh build-binutils.sh /tmp/
26
27 # We need a build of openssl which supports SNI to download artifacts from
28 # static.rust-lang.org. This'll be used to link into libcurl below (and used
29 # later as well), so build a copy of OpenSSL with dynamic libraries into our
30 # generic root.
31 COPY build-openssl.sh /tmp/
32 RUN ./build-openssl.sh
33
34 # The `curl` binary on CentOS doesn't support SNI which is needed for fetching
35 # some https urls we have, so install a new version of libcurl + curl which is
36 # using the openssl we just built previously.
37 #
38 # Note that we also disable a bunch of optional features of curl that we don't
39 # really need.
40 COPY build-curl.sh /tmp/
41 RUN ./build-curl.sh
42
43 # binutils < 2.22 has a bug where the 32-bit executables it generates
44 # immediately segfault in Rust, so we need to install our own binutils.
45 #
46 # See https://github.com/rust-lang/rust/issues/20440 for more info
47 RUN ./build-binutils.sh
48
49 # Need a newer version of gcc than centos has to compile LLVM nowadays
50 COPY build-gcc.sh /tmp/
51 RUN ./build-gcc.sh
52
53 # CentOS 5.5 has Python 2.4 by default, but LLVM needs 2.7+
54 COPY build-python.sh /tmp/
55 RUN ./build-python.sh
56
57 # Apparently CentOS 5.5 desn't have `git` in yum, but we're gonna need it for
58 # cloning, so download and build it here.
59 COPY build-git.sh /tmp/
60 RUN ./build-git.sh
61
62 # libssh2 (a dependency of Cargo) requires cmake 2.8.11 or higher but CentOS
63 # only has 2.6.4, so build our own
64 COPY build-cmake.sh /tmp/
65 RUN ./build-cmake.sh
66
67 # for sanitizers, we need kernel headers files newer than the ones CentOS ships
68 # with so we install newer ones here
69 COPY build-headers.sh /tmp/
70 RUN ./build-headers.sh
71
72 RUN curl -Lo /rustroot/dumb-init \
73       https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 && \
74       chmod +x /rustroot/dumb-init
75 ENTRYPOINT ["/rustroot/dumb-init", "--"]
76
77 RUN curl -o /usr/local/bin/sccache \
78       https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-16-sccache-x86_64-unknown-linux-musl && \
79       chmod +x /usr/local/bin/sccache
80
81 ENV HOSTS=i686-unknown-linux-gnu
82 ENV HOSTS=$HOSTS,x86_64-unknown-linux-gnu
83
84 ENV RUST_CONFIGURE_ARGS \
85       --host=$HOSTS \
86       --enable-extended \
87       --enable-sanitizers
88 ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
89
90 # This is the only builder which will create source tarballs
91 ENV DIST_SRC 1
92
93 # When we build cargo in this container, we don't want it to use the system
94 # libcurl, instead it should compile its own.
95 ENV LIBCURL_NO_PKG_CONFIG 1