| # Copyright 2026 The Fuchsia Authors | |
| # | |
| # Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0 | |
| # <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT | |
| # license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option. | |
| # This file may not be copied, modified, or distributed except according to | |
| # those terms. | |
| FROM docker.io/library/ubuntu:24.04@sha256:9a04f13b3f80ef056361e30868593b1cfd2279fe19e4081cb93a90bf56819d6a | |
| SHELL ["/bin/bash", "-euo", "pipefail", "-c"] | |
| ARG PIN_RUST_TOOLCHAINS__STABLE | |
| ARG PIN_RUST_TOOLCHAINS__NIGHTLY | |
| ENV CARGO_NET_RETRY=10 \ | |
| RUSTUP_MAX_RETRIES=10 \ | |
| RUSTUP_HOME=/usr/local/rustup \ | |
| CARGO_HOME=/usr/local/cargo \ | |
| CARGO_TERM_COLOR=always \ | |
| PATH="/usr/local/cargo/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | |
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | |
| ca-certificates \ | |
| curl \ | |
| xz-utils \ | |
| jq \ | |
| build-essential \ | |
| pkg-config \ | |
| git \ | |
| ripgrep \ | |
| python3 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN mkdir -p /tmp/dl && \ | |
| curl -fsSL --retry 3 -o /usr/local/bin/action-validator \ | |
| "https://github.com/mpalmer/action-validator/releases/download/v0.8.0/action-validator_linux_amd64" && \ | |
| echo "d1d9b787b897c6f8ef9e2f42c2553ce5d0a242aae3bca998d2c67dc69348b128 /usr/local/bin/action-validator" | sha256sum -c - && \ | |
| chmod 0755 /usr/local/bin/action-validator && \ | |
| curl -fsSL --retry 3 -o /usr/local/bin/yq \ | |
| "https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64" && \ | |
| echo "6dc2d0cd4e0caca5aeffd0d784a48263591080e4a0895abe69f3a76eb50d1ba3 /usr/local/bin/yq" | sha256sum -c - && \ | |
| chmod 0755 /usr/local/bin/yq && \ | |
| curl -fsSL --retry 3 -o /tmp/dl/shellcheck.tar.xz \ | |
| "https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz" && \ | |
| echo "6c881ab0698e4e6ea235245f22832860544f17ba386442fe7e9d629f8cbedf87 /tmp/dl/shellcheck.tar.xz" | sha256sum -c - && \ | |
| tar -xJf /tmp/dl/shellcheck.tar.xz --strip-components=1 -C /usr/local/bin shellcheck-v0.10.0/shellcheck && \ | |
| chmod 0755 /usr/local/bin/shellcheck && \ | |
| curl -fsSL --retry 3 -o /tmp/dl/zizmor.tar.gz \ | |
| "https://github.com/zizmorcore/zizmor/releases/download/v1.23.1/zizmor-x86_64-unknown-linux-gnu.tar.gz" && \ | |
| echo "67a8df0a14352dd81882e14876653d097b99b0f4f6b6fe798edc0320cff27aff /tmp/dl/zizmor.tar.gz" | sha256sum -c - && \ | |
| tar -xzf /tmp/dl/zizmor.tar.gz -C /usr/local/bin ./zizmor && \ | |
| chmod 0755 /usr/local/bin/zizmor && \ | |
| rm -rf /tmp/dl | |
| RUN curl -fsSL --retry 3 -o /tmp/rustup-init \ | |
| "https://static.rust-lang.org/rustup/archive/1.29.3/x86_64-unknown-linux-gnu/rustup-init" && \ | |
| echo "b1c8cb14e30889e7e2999e6b69e62d9e9b9ffc0f4df8180564d306d9680e6c55 /tmp/rustup-init" | sha256sum -c - && \ | |
| chmod 0755 /tmp/rustup-init && \ | |
| /tmp/rustup-init -y --default-toolchain none --profile minimal --no-modify-path && \ | |
| rm -f /tmp/rustup-init && \ | |
| rustup toolchain install "${PIN_RUST_TOOLCHAINS__STABLE}" --profile minimal -c rust-src -c rustfmt -c clippy && \ | |
| rustup toolchain install "${PIN_RUST_TOOLCHAINS__NIGHTLY}" --profile minimal -c rustfmt && \ | |
| rustup default "${PIN_RUST_TOOLCHAINS__STABLE}" && \ | |
| rustup target add --toolchain "${PIN_RUST_TOOLCHAINS__STABLE}" wasm32-unknown-unknown && \ | |
| rm -rf /usr/local/cargo/registry /usr/local/cargo/git \ | |
| /usr/local/rustup/downloads /usr/local/rustup/tmp \ | |
| /usr/local/rustup/toolchains/*/share/doc /usr/local/rustup/toolchains/*/share/man && \ | |
| chmod -R a+rX /usr/local/rustup /usr/local/cargo | |
| COPY ci/pins/zerocopy-dogfood.json /tmp/zerocopy-dogfood.json | |
| COPY ci/scripts/fetch_zerocopy_dogfood.py /tmp/fetch_zerocopy_dogfood.py | |
| RUN python3 -I -B /tmp/fetch_zerocopy_dogfood.py /tmp/zerocopy-dogfood.json /opt/zerocopy-dogfood && \ | |
| rm -f /tmp/zerocopy-dogfood.json /tmp/fetch_zerocopy_dogfood.py && \ | |
| chmod -R a+rX /opt/zerocopy-dogfood |