@@ -2,7 +2,7 @@ FROM ubuntu:24.04@sha256:b59d21599a2b151e23eea5f6602f4af4d7d31c4e236d22bf0b62b86
22
33ARG BATS_VERSION=1.11.0
44ARG CARGO_BINSTALL_VERSION=1.12.2
5- ARG RUST_VERSION=1.86 .0
5+ ARG RUST_VERSION=1.87 .0
66
77ARG DEBIAN_FRONTEND=noninteractive
88
@@ -11,19 +11,21 @@ HEALTHCHECK NONE
1111SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
1212
1313# Install the base system with all tool dependencies
14- COPY .devcontainer/rust/apt-requirements-base.json /tmp/apt-requirements-base.json
1514# hadolint ignore=DL3008
16- RUN apt-get update && apt-get install -y --no-install-recommends jq \
17- && jq -r 'to_entries | .[] | .key + "=" + .value' /tmp/apt-requirements-base.json | xargs apt-get install -y --no-install-recommends \
18- && rm /tmp/apt-requirements-base.json \
19- && rm -rf /var/lib/apt/lists/*
15+ RUN --mount=type=bind,source=.devcontainer/rust/apt-requirements-base.json,target=/tmp/apt-requirements-base.json \
16+ --mount=type=cache,target=/var/cache/apt,sharing=locked \
17+ --mount=type=cache,target=/var/lib/apt,sharing=locked \
18+ --mount=type=cache,target=/var/log,sharing=locked \
19+ apt-get update && apt-get install -y --no-install-recommends jq \
20+ && jq -r 'to_entries | .[] | .key + "=" + .value' /tmp/apt-requirements-base.json | xargs apt-get install -y --no-install-recommends
2021
2122# Include the Cisco Umbrella PKI Root
2223RUN wget -qO /usr/local/share/ca-certificates/Cisco_Umbrella_Root_CA.crt https://www.cisco.com/security/pki/certs/ciscoumbrellaroot.pem \
2324 && update-ca-certificates
2425
2526# Install rust
26- ENV CARGO_HOME=/usr/local/cargo \
27+ ENV BINSTALL_DISABLE_TELEMETRY=true \
28+ CARGO_HOME=/usr/local/cargo \
2729 RUSTUP_HOME=/usr/local/rustup \
2830 PATH=/usr/local/cargo/bin:"$PATH"
2931RUN rustup set profile minimal \
@@ -42,10 +44,10 @@ RUN batstmp="$(mktemp -d /tmp/bats-core-${BATS_VERSION}.XXXX)" \
4244
4345# Update all tool alternatives to the correct version
4446# and patch root's bashrc to include bash-completion
45- RUN update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 20 \
47+ RUN --mount=type=cache,target=/var/log,sharing=locked \
48+ update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 20 \
4649 && cp /etc/skel/.bashrc /root/.bashrc
4750
48- ENV BINSTALL_DISABLE_TELEMETRY=true
4951# Install additional rust tools
5052RUN wget -qO - "https://github.com/cargo-bins/cargo-binstall/releases/download/v${CARGO_BINSTALL_VERSION}/cargo-binstall-$(uname -m)-unknown-linux-gnu.tgz" | tar xz -C "/usr/bin" \
5153 && cargo-binstall -y --locked cargo-binutils@0.3.6 cargo-mutants@25.0.0 flip-link@0.1.10 \
0 commit comments