Skip to content

Commit 90cb011

Browse files
committed
Refactor dockerfiles to have a common base image.
1 parent ebbc9ea commit 90cb011

File tree

43 files changed

+109
-1076
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+109
-1076
lines changed

src/ci/docker/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Images will output artifacts in an `obj` dir at the root of a repository.
2121
- Each directory, excluding `scripts` and `disabled`, corresponds to a docker image
2222
- `scripts` contains files shared by docker images
2323
- `disabled` contains images that are not build travis
24+
- `base` contains that is used as a base for most of the remaining images.
25+
It cannot be run directly.
2426

2527
## Cross toolchains
2628

src/ci/docker/arm-android/Dockerfile

+1-25
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
1-
FROM ubuntu:16.04
2-
3-
RUN apt-get update && \
4-
apt-get install -y --no-install-recommends \
5-
ca-certificates \
6-
cmake \
7-
curl \
8-
file \
9-
g++ \
10-
git \
11-
libssl-dev \
12-
make \
13-
pkg-config \
14-
python2.7 \
15-
sudo \
16-
unzip \
17-
xz-utils
18-
19-
# dumb-init
20-
COPY scripts/dumb-init.sh /scripts/
21-
RUN sh /scripts/dumb-init.sh
1+
FROM rust-ci-base
222

233
# ndk
244
COPY scripts/android-ndk.sh /scripts/
@@ -51,10 +31,6 @@ ENV RUST_CONFIGURE_ARGS \
5131

5232
ENV SCRIPT python2.7 ../x.py test --target $TARGETS
5333

54-
# sccache
55-
COPY scripts/sccache.sh /scripts/
56-
RUN sh /scripts/sccache.sh
57-
5834
# init
5935
COPY scripts/android-start-emulator.sh /scripts/
6036
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/scripts/android-start-emulator.sh"]

src/ci/docker/armhf-gnu/Dockerfile

+1-23
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1-
FROM ubuntu:16.04
1+
FROM rust-ci-base
22

33
RUN apt-get update -y && apt-get install -y --no-install-recommends \
4-
bc \
5-
bzip2 \
6-
ca-certificates \
7-
cmake \
8-
cpio \
9-
curl \
10-
file \
11-
g++ \
124
gcc-arm-linux-gnueabihf \
13-
git \
14-
libc6-dev \
155
libc6-dev-armhf-cross \
16-
make \
17-
python2.7 \
186
qemu-system-arm \
19-
xz-utils
207

218
ENV ARCH=arm \
229
CROSS_COMPILE=arm-linux-gnueabihf-
@@ -73,15 +60,6 @@ RUN arm-linux-gnueabihf-gcc addentropy.c -o rootfs/addentropy -static
7360
# TODO: What is this?!
7461
RUN curl -O http://ftp.nl.debian.org/debian/dists/jessie/main/installer-armhf/current/images/device-tree/vexpress-v2p-ca15-tc1.dtb
7562

76-
RUN curl -o /usr/local/bin/sccache \
77-
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-unknown-linux-musl && \
78-
chmod +x /usr/local/bin/sccache
79-
80-
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
81-
dpkg -i dumb-init_*.deb && \
82-
rm dumb-init_*.deb
83-
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
84-
8563
ENV RUST_CONFIGURE_ARGS \
8664
--target=arm-unknown-linux-gnueabihf \
8765
--qemu-armhf-rootfs=/tmp/rootfs

src/ci/docker/asmjs/Dockerfile

+1-25
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
1-
FROM ubuntu:16.04
2-
3-
RUN apt-get update && apt-get install -y --no-install-recommends \
4-
g++ \
5-
make \
6-
file \
7-
curl \
8-
ca-certificates \
9-
python \
10-
git \
11-
cmake \
12-
sudo \
13-
gdb \
14-
xz-utils
15-
16-
# dumb-init
17-
COPY scripts/dumb-init.sh /scripts/
18-
RUN sh /scripts/dumb-init.sh
1+
FROM rust-ci-base
192

203
# emscripten
214
COPY scripts/emscripten.sh /scripts/
@@ -35,10 +18,3 @@ ENV TARGETS=asmjs-unknown-emscripten
3518
ENV RUST_CONFIGURE_ARGS --target=$TARGETS
3619

3720
ENV SCRIPT python2.7 ../x.py test --target $TARGETS
38-
39-
# cache
40-
COPY scripts/sccache.sh /scripts/
41-
RUN sh /scripts/sccache.sh
42-
43-
# init
44-
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

src/ci/docker/base/Dockerfile

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
automake \
5+
bc \
6+
bison \
7+
bzip2 \
8+
ca-certificates \
9+
cmake \
10+
cpio \
11+
curl \
12+
file \
13+
flex \
14+
g++ \
15+
gawk \
16+
gdb \
17+
git \
18+
gperf \
19+
help2man \
20+
libc6-dev \
21+
libedit-dev \
22+
libncurses-dev \
23+
libncurses5-dev \
24+
libssl-dev \
25+
libtool-bin \
26+
make \
27+
patch \
28+
pkg-config \
29+
python2.7 \
30+
python2.7-dev \
31+
sudo \
32+
texinfo \
33+
unzip \
34+
wget \
35+
xz-utils \
36+
zlib1g-dev
37+
38+
RUN curl -o /usr/local/bin/sccache \
39+
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-unknown-linux-musl && \
40+
chmod +x /usr/local/bin/sccache
41+
42+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
43+
dpkg -i dumb-init_*.deb && \
44+
rm dumb-init_*.deb
45+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

src/ci/docker/cross/Dockerfile

+2-28
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
1-
FROM ubuntu:16.04
1+
FROM rust-ci-base
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
4-
g++ \
5-
make \
6-
file \
7-
curl \
8-
ca-certificates \
9-
python2.7 \
10-
git \
11-
cmake \
12-
sudo \
13-
xz-utils \
14-
zlib1g-dev \
154
g++-arm-linux-gnueabi \
165
g++-arm-linux-gnueabihf \
176
gcc-sparc64-linux-gnu \
18-
libc6-dev-sparc64-cross \
19-
bzip2 \
20-
patch \
21-
libssl-dev \
22-
pkg-config
23-
24-
# dumb-init
25-
COPY scripts/dumb-init.sh /scripts/
26-
RUN sh /scripts/dumb-init.sh
7+
libc6-dev-sparc64-cross
278

289
WORKDIR /tmp
2910

@@ -63,10 +44,3 @@ ENV RUST_CONFIGURE_ARGS \
6344
--musl-root-armhf=/usr/local/arm-linux-musleabihf \
6445
--musl-root-armv7=/usr/local/armv7-linux-musleabihf
6546
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
66-
67-
# sccache
68-
COPY scripts/sccache.sh /scripts/
69-
RUN sh /scripts/sccache.sh
70-
71-
# init
72-
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
1-
FROM ubuntu:16.04
2-
3-
RUN apt-get update && \
4-
apt-get install -y --no-install-recommends \
5-
ca-certificates \
6-
cmake \
7-
curl \
8-
file \
9-
g++ \
10-
git \
11-
libssl-dev \
12-
make \
13-
pkg-config \
14-
python2.7 \
15-
sudo \
16-
unzip \
17-
xz-utils
18-
19-
# dumb-init
20-
COPY scripts/dumb-init.sh /scripts/
21-
RUN sh /scripts/dumb-init.sh
1+
FROM rust-ci-base
222

233
# ndk
244
COPY scripts/android-ndk.sh /scripts/
@@ -41,10 +21,3 @@ ENV RUST_CONFIGURE_ARGS \
4121
--enable-cargo-openssl-static
4222

4323
ENV SCRIPT python2.7 ../x.py dist --target $HOSTS --host $HOSTS
44-
45-
# sccache
46-
COPY scripts/sccache.sh /scripts/
47-
RUN sh /scripts/sccache.sh
48-
49-
# init
50-
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

src/ci/docker/disabled/dist-armv7-android/Dockerfile

+1-28
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
1-
FROM ubuntu:16.04
2-
3-
RUN apt-get update && \
4-
apt-get install -y --no-install-recommends \
5-
ca-certificates \
6-
cmake \
7-
curl \
8-
file \
9-
g++ \
10-
git \
11-
libssl-dev \
12-
make \
13-
pkg-config \
14-
python2.7 \
15-
sudo \
16-
unzip \
17-
xz-utils
18-
19-
# dumb-init
20-
COPY scripts/dumb-init.sh /scripts/
21-
RUN sh /scripts/dumb-init.sh
1+
FROM rust-ci-base
222

233
# ndk
244
COPY scripts/android-ndk.sh /scripts/
@@ -59,10 +39,3 @@ ENV SCRIPT \
5939
rm /android/ndk/arm && \
6040
ln -s /android/ndk/arm-9 /android/ndk/arm && \
6141
python2.7 ../x.py dist --host $HOSTS --target $HOSTS)
62-
63-
# sccache
64-
COPY scripts/sccache.sh /scripts/
65-
RUN sh /scripts/sccache.sh
66-
67-
# init
68-
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

src/ci/docker/disabled/dist-i686-android/Dockerfile

+1-25
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
1-
FROM ubuntu:16.04
2-
3-
RUN apt-get update && \
4-
apt-get install -y --no-install-recommends \
5-
ca-certificates \
6-
cmake \
7-
curl \
8-
file \
9-
g++ \
10-
git \
11-
libssl-dev \
12-
make \
13-
pkg-config \
14-
python2.7 \
15-
sudo \
16-
unzip \
17-
xz-utils
18-
19-
# dumb-init
20-
COPY scripts/dumb-init.sh /scripts/
21-
RUN sh /scripts/dumb-init.sh
1+
FROM rust-ci-base
222

233
# ndk
244
COPY scripts/android-ndk.sh /scripts/
@@ -60,9 +40,5 @@ ENV SCRIPT \
6040
ln -s /android/ndk/x86-9 /android/ndk/x86 && \
6141
python2.7 ../x.py dist --host $HOSTS --target $HOSTS)
6242

63-
# sccache
64-
COPY scripts/sccache.sh /scripts/
65-
RUN sh /scripts/sccache.sh
66-
6743
# init
6844
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
1-
FROM ubuntu:16.04
2-
3-
RUN apt-get update && \
4-
apt-get install -y --no-install-recommends \
5-
ca-certificates \
6-
cmake \
7-
curl \
8-
file \
9-
g++ \
10-
git \
11-
libssl-dev \
12-
make \
13-
pkg-config \
14-
python2.7 \
15-
sudo \
16-
unzip \
17-
xz-utils
18-
19-
# dumb-init
20-
COPY scripts/dumb-init.sh /scripts/
21-
RUN sh /scripts/dumb-init.sh
1+
FROM rust-ci-base
222

233
# ndk
244
COPY scripts/android-ndk.sh /scripts/
@@ -42,9 +22,5 @@ ENV RUST_CONFIGURE_ARGS \
4222

4323
ENV SCRIPT python2.7 ../x.py dist --target $HOSTS --host $HOSTS
4424

45-
# sccache
46-
COPY scripts/sccache.sh /scripts/
47-
RUN sh /scripts/sccache.sh
48-
4925
# init
5026
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+1-25
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
1-
FROM ubuntu:16.04
2-
3-
RUN apt-get update && apt-get install -y --no-install-recommends \
4-
g++ \
5-
make \
6-
file \
7-
curl \
8-
ca-certificates \
9-
python \
10-
git \
11-
cmake \
12-
sudo \
13-
gdb \
14-
xz-utils
15-
16-
# dumb-init
17-
COPY scripts/dumb-init.sh /scripts/
18-
RUN sh /scripts/dumb-init.sh
1+
FROM rust-ci-base
192

203
# emscripten
214
COPY scripts/emscripten.sh /scripts/
@@ -35,10 +18,3 @@ ENV TARGETS=wasm32-unknown-emscripten
3518
ENV RUST_CONFIGURE_ARGS --target=$TARGETS
3619

3720
ENV SCRIPT python2.7 ../x.py test --target $TARGETS
38-
39-
# cache
40-
COPY scripts/sccache.sh /scripts/
41-
RUN sh /scripts/sccache.sh
42-
43-
# init
44-
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

0 commit comments

Comments
 (0)