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