|
3 | 3 | # SPDX-License-Identifier: Apache-2.0 |
4 | 4 | FROM gramineproject/gramine:1.9-jammy@sha256:84b3d222e0bd9ab941f0078a462af0dbc5518156b99b147c10a7b83722ac0c38 |
5 | 5 |
|
6 | | -RUN apt-get update && apt-get install -y \ |
7 | | - git=1:2.34.1-1ubuntu1.17 \ |
8 | | - build-essential=12.9ubuntu3 \ |
9 | | - && rm -rf /var/lib/apt/lists/* |
| 6 | +# Pin Ubuntu apt sources to a fixed snapshot date so transitive dependencies |
| 7 | +# (e.g. libcurl3-gnutls, libc6) don't drift between builds. Without this, |
| 8 | +# Ubuntu point updates to packages pulled in by `build-essential` change the |
| 9 | +# bytes of files referenced by the Gramine manifest's trusted_files list, |
| 10 | +# which changes mr_enclave — breaking any attestation flow that pins to a |
| 11 | +# specific expected value. |
| 12 | +# |
| 13 | +# Each consumer should override APT_SNAPSHOT to the date that matches their |
| 14 | +# expected mr_enclave: |
| 15 | +# |
| 16 | +# docker build --build-arg APT_SNAPSHOT=YYYYMMDDT000000Z ... |
| 17 | +ARG APT_SNAPSHOT=20260423T000000Z |
| 18 | +RUN { \ |
| 19 | + echo "deb https://snapshot.ubuntu.com/ubuntu/${APT_SNAPSHOT} jammy main universe restricted multiverse"; \ |
| 20 | + echo "deb https://snapshot.ubuntu.com/ubuntu/${APT_SNAPSHOT} jammy-updates main universe restricted multiverse"; \ |
| 21 | + echo "deb https://snapshot.ubuntu.com/ubuntu/${APT_SNAPSHOT} jammy-security main universe restricted multiverse"; \ |
| 22 | + } > /etc/apt/sources.list \ |
| 23 | + && rm -rf /etc/apt/sources.list.d/* \ |
| 24 | + && apt-get update && apt-get install -y \ |
| 25 | + git=1:2.34.1-1ubuntu1.17 \ |
| 26 | + build-essential=12.9ubuntu3 \ |
| 27 | + && rm -rf /var/lib/apt/lists/* |
10 | 28 |
|
11 | | -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.85 -y |
| 29 | +# Pin rustup-init by sha256 instead of `curl https://sh.rustup.rs | sh` so the |
| 30 | +# installer bytes are deterministic. Pin --default-toolchain to the exact patch |
| 31 | +# version (1.85 alone resolves to the latest 1.85.x at install time). |
| 32 | +# |
| 33 | +# To bump RUSTUP_VERSION, fetch the matching sha256 with: |
| 34 | +# curl -sf https://static.rust-lang.org/rustup/archive/<VERSION>/x86_64-unknown-linux-gnu/rustup-init.sha256 |
| 35 | +ARG RUSTUP_VERSION=1.28.2 |
| 36 | +ARG RUSTUP_INIT_SHA256=20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c |
| 37 | +ARG RUST_TOOLCHAIN=1.85.1 |
| 38 | +RUN curl --proto '=https' --tlsv1.2 -fsSL \ |
| 39 | + "https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/x86_64-unknown-linux-gnu/rustup-init" \ |
| 40 | + -o /tmp/rustup-init \ |
| 41 | + && echo "${RUSTUP_INIT_SHA256} /tmp/rustup-init" | sha256sum -c - \ |
| 42 | + && chmod +x /tmp/rustup-init \ |
| 43 | + && /tmp/rustup-init -y --default-toolchain "${RUST_TOOLCHAIN}" \ |
| 44 | + && rm /tmp/rustup-init |
12 | 45 | ENV PATH="/root/.cargo/bin:${PATH}" |
13 | 46 |
|
14 | 47 | # Set environment variables |
|
0 commit comments