|
1 | 1 | # always build this using the latest stable release
|
2 |
| -FROM rust:1.70.0 as build |
| 2 | +FROM rust:1.71.0 as build |
3 | 3 |
|
4 | 4 |
|
5 | 5 | ARG JQ_VERSION=1.6
|
@@ -34,8 +34,60 @@ COPY local-registry/* ./
|
34 | 34 | RUN ${wd}/bin/generate-registry.sh
|
35 | 35 |
|
36 | 36 | # As of Dec 2019, we need to use the nightly toolchain to get JSON test output
|
37 |
| -FROM rust:1.70.0 AS test |
38 |
| -RUN rustup toolchain add nightly |
| 37 | +# tracking issue: https://github.com/rust-lang/rust/issues/49359 |
| 38 | + |
| 39 | +# Official docker images with pinned nightly versions are not provided, but we |
| 40 | +# want to pin the nightly version to avoid unnecessary cache misses. To achieve |
| 41 | +# this, we copy the source of the official rust docker images and replace the |
| 42 | +# version tag with a nightly one, pinned to a specific date. |
| 43 | + |
| 44 | +# official Dockerfile source: |
| 45 | +# https://github.com/rust-lang/docker-rust/blob/master/1.71.0/bookworm/slim/Dockerfile |
| 46 | + |
| 47 | +################ start-copy-pasta ################ |
| 48 | + |
| 49 | +FROM debian:bookworm-slim |
| 50 | + |
| 51 | +ENV RUSTUP_HOME=/usr/local/rustup \ |
| 52 | + CARGO_HOME=/usr/local/cargo \ |
| 53 | + PATH=/usr/local/cargo/bin:$PATH \ |
| 54 | + RUST_VERSION=nightly-2023-07-18 |
| 55 | +# ~~~~~~~~^~~~~~~~~~ |
| 56 | +# pin version here |
| 57 | + |
| 58 | +RUN set -eux; \ |
| 59 | + apt-get update; \ |
| 60 | + apt-get install -y --no-install-recommends \ |
| 61 | + ca-certificates \ |
| 62 | + gcc \ |
| 63 | + libc6-dev \ |
| 64 | + wget \ |
| 65 | + ; \ |
| 66 | + dpkgArch="$(dpkg --print-architecture)"; \ |
| 67 | + case "${dpkgArch##*-}" in \ |
| 68 | + amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db' ;; \ |
| 69 | + armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a' ;; \ |
| 70 | + arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \ |
| 71 | + i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333' ;; \ |
| 72 | + *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ |
| 73 | + esac; \ |
| 74 | + url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \ |
| 75 | + wget "$url"; \ |
| 76 | + echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ |
| 77 | + chmod +x rustup-init; \ |
| 78 | + ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ |
| 79 | + rm rustup-init; \ |
| 80 | + chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ |
| 81 | + rustup --version; \ |
| 82 | + cargo --version; \ |
| 83 | + rustc --version; \ |
| 84 | + apt-get remove -y --auto-remove \ |
| 85 | + wget \ |
| 86 | + ; \ |
| 87 | + rm -rf /var/lib/apt/lists/*; |
| 88 | + |
| 89 | +################ end-copy-pasta ################ |
| 90 | + |
39 | 91 | ENV wd /opt/test-runner
|
40 | 92 | RUN mkdir -p ${wd}/bin
|
41 | 93 | WORKDIR ${wd}
|
|
0 commit comments