Skip to content
This repository was archived by the owner on Feb 17, 2024. It is now read-only.

Commit 43e76b4

Browse files
committed
Dockerfile: build docker image "from scratch" instad of "from rust"
RUSTC_BOOTSTRAP=1 doesn't work so well anymore in stable, so we had to migrate to nightly - which required us to install the toolchain in an image that already has one. If we install rust manually in a debian-slim, we save ~500MB. We are also pinning nightly to a version where coverage works. Ref: rust-lang/rust#93054
1 parent d821b51 commit 43e76b4

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

Dockerfile

+27-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,33 @@
22
# This file is subject to the terms and conditions defined in
33
# file 'LICENSE', which is part of this source code package.
44

5-
FROM rust:slim
6-
RUN set -e -x; \
5+
# Adapted from https://github.com/rust-lang/docker-rust/blob/master/Dockerfile-slim.template
6+
7+
FROM debian:bullseye-slim
8+
9+
ENV RUSTUP_HOME=/usr/local/rustup \
10+
CARGO_HOME=/usr/local/cargo \
11+
PATH=/usr/local/cargo/bin:$PATH
12+
13+
RUN set -eux; \
14+
apt-get update; \
15+
apt-get install -y --no-install-recommends \
16+
ca-certificates \
17+
gcc \
18+
libc6-dev \
19+
wget \
20+
; \
21+
wget https://sh.rustup.rs -O rustup-init; \
22+
bash rustup-init -y --no-modify-path --profile minimal --default-toolchain nightly-2022-01-14; \
23+
rm rustup-init; \
24+
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
25+
rustup --version; \
26+
cargo --version; \
27+
rustc --version; \
28+
apt-get remove -y --auto-remove \
29+
wget \
30+
; \
31+
rm -rf /var/lib/apt/lists/*; \
732
rustup component add llvm-tools-preview; \
833
cargo install cargo-llvm-cov
934

0 commit comments

Comments
 (0)