Skip to content

Refactor dockerfiles to have a common base image. #42691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ci/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Images will output artifacts in an `obj` dir at the root of a repository.
- Each directory, excluding `scripts` and `disabled`, corresponds to a docker image
- `scripts` contains files shared by docker images
- `disabled` contains images that are not build travis
- `base` contains that is used as a base for most of the remaining images.
It cannot be run directly.

## Cross toolchains

Expand Down
26 changes: 1 addition & 25 deletions src/ci/docker/arm-android/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
FROM ubuntu:16.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
curl \
file \
g++ \
git \
libssl-dev \
make \
pkg-config \
python2.7 \
sudo \
unzip \
xz-utils

# dumb-init
COPY scripts/dumb-init.sh /scripts/
RUN sh /scripts/dumb-init.sh
FROM rust-ci-base

# ndk
COPY scripts/android-ndk.sh /scripts/
Expand Down Expand Up @@ -51,10 +31,6 @@ ENV RUST_CONFIGURE_ARGS \

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

# sccache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# init
COPY scripts/android-start-emulator.sh /scripts/
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/scripts/android-start-emulator.sh"]
24 changes: 1 addition & 23 deletions src/ci/docker/armhf-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
FROM ubuntu:16.04
FROM rust-ci-base

RUN apt-get update -y && apt-get install -y --no-install-recommends \
bc \
bzip2 \
ca-certificates \
cmake \
cpio \
curl \
file \
g++ \
gcc-arm-linux-gnueabihf \
git \
libc6-dev \
libc6-dev-armhf-cross \
make \
python2.7 \
qemu-system-arm \
xz-utils

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

RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

ENV RUST_CONFIGURE_ARGS \
--target=arm-unknown-linux-gnueabihf \
--qemu-armhf-rootfs=/tmp/rootfs
Expand Down
26 changes: 1 addition & 25 deletions src/ci/docker/asmjs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python \
git \
cmake \
sudo \
gdb \
xz-utils

# dumb-init
COPY scripts/dumb-init.sh /scripts/
RUN sh /scripts/dumb-init.sh
FROM rust-ci-base

# emscripten
COPY scripts/emscripten.sh /scripts/
Expand All @@ -35,10 +18,3 @@ ENV TARGETS=asmjs-unknown-emscripten
ENV RUST_CONFIGURE_ARGS --target=$TARGETS

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

# cache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
45 changes: 45 additions & 0 deletions src/ci/docker/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
automake \
bc \
bison \
bzip2 \
ca-certificates \
cmake \
cpio \
curl \
file \
flex \
g++ \
gawk \
gdb \
git \
gperf \
help2man \
libc6-dev \
libedit-dev \
libncurses-dev \
libncurses5-dev \
libssl-dev \
libtool-bin \
make \
patch \
pkg-config \
python2.7 \
python2.7-dev \
sudo \
texinfo \
unzip \
wget \
xz-utils \
zlib1g-dev

RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
30 changes: 2 additions & 28 deletions src/ci/docker/cross/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
FROM ubuntu:16.04
FROM rust-ci-base

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
sudo \
xz-utils \
zlib1g-dev \
g++-arm-linux-gnueabi \
g++-arm-linux-gnueabihf \
gcc-sparc64-linux-gnu \
libc6-dev-sparc64-cross \
bzip2 \
patch \
libssl-dev \
pkg-config

# dumb-init
COPY scripts/dumb-init.sh /scripts/
RUN sh /scripts/dumb-init.sh
libc6-dev-sparc64-cross

WORKDIR /tmp

Expand Down Expand Up @@ -63,10 +44,3 @@ ENV RUST_CONFIGURE_ARGS \
--musl-root-armhf=/usr/local/arm-linux-musleabihf \
--musl-root-armv7=/usr/local/armv7-linux-musleabihf
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS

# sccache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
29 changes: 1 addition & 28 deletions src/ci/docker/disabled/dist-aarch64-android/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
FROM ubuntu:16.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
curl \
file \
g++ \
git \
libssl-dev \
make \
pkg-config \
python2.7 \
sudo \
unzip \
xz-utils

# dumb-init
COPY scripts/dumb-init.sh /scripts/
RUN sh /scripts/dumb-init.sh
FROM rust-ci-base

# ndk
COPY scripts/android-ndk.sh /scripts/
Expand All @@ -41,10 +21,3 @@ ENV RUST_CONFIGURE_ARGS \
--enable-cargo-openssl-static

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

# sccache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
29 changes: 1 addition & 28 deletions src/ci/docker/disabled/dist-armv7-android/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
FROM ubuntu:16.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
curl \
file \
g++ \
git \
libssl-dev \
make \
pkg-config \
python2.7 \
sudo \
unzip \
xz-utils

# dumb-init
COPY scripts/dumb-init.sh /scripts/
RUN sh /scripts/dumb-init.sh
FROM rust-ci-base

# ndk
COPY scripts/android-ndk.sh /scripts/
Expand Down Expand Up @@ -59,10 +39,3 @@ ENV SCRIPT \
rm /android/ndk/arm && \
ln -s /android/ndk/arm-9 /android/ndk/arm && \
python2.7 ../x.py dist --host $HOSTS --target $HOSTS)

# sccache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
26 changes: 1 addition & 25 deletions src/ci/docker/disabled/dist-i686-android/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
FROM ubuntu:16.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
curl \
file \
g++ \
git \
libssl-dev \
make \
pkg-config \
python2.7 \
sudo \
unzip \
xz-utils

# dumb-init
COPY scripts/dumb-init.sh /scripts/
RUN sh /scripts/dumb-init.sh
FROM rust-ci-base

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

# sccache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
26 changes: 1 addition & 25 deletions src/ci/docker/disabled/dist-x86_64-android/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
FROM ubuntu:16.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
curl \
file \
g++ \
git \
libssl-dev \
make \
pkg-config \
python2.7 \
sudo \
unzip \
xz-utils

# dumb-init
COPY scripts/dumb-init.sh /scripts/
RUN sh /scripts/dumb-init.sh
FROM rust-ci-base

# ndk
COPY scripts/android-ndk.sh /scripts/
Expand All @@ -42,9 +22,5 @@ ENV RUST_CONFIGURE_ARGS \

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

# sccache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
26 changes: 1 addition & 25 deletions src/ci/docker/disabled/wasm32/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python \
git \
cmake \
sudo \
gdb \
xz-utils

# dumb-init
COPY scripts/dumb-init.sh /scripts/
RUN sh /scripts/dumb-init.sh
FROM rust-ci-base

# emscripten
COPY scripts/emscripten.sh /scripts/
Expand All @@ -35,10 +18,3 @@ ENV TARGETS=wasm32-unknown-emscripten
ENV RUST_CONFIGURE_ARGS --target=$TARGETS

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

# cache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# init
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
Loading