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