├── .gitignore ├── versions.toml ├── Dockerfile-debian.template ├── Dockerfile-alpine.template ├── LICENSE-MIT ├── Dockerfile-slim.template ├── .github └── workflows │ ├── ci.yml │ ├── nightly.yml │ └── mirror_stable.yml ├── nightly ├── alpine3.20 │ └── Dockerfile ├── alpine3.21 │ └── Dockerfile ├── alpine3.22 │ └── Dockerfile ├── alpine3.23 │ └── Dockerfile ├── bullseye │ ├── Dockerfile │ └── slim │ │ └── Dockerfile ├── bookworm │ ├── Dockerfile │ └── slim │ │ └── Dockerfile └── trixie │ ├── Dockerfile │ └── slim │ └── Dockerfile ├── stable ├── alpine3.20 │ └── Dockerfile ├── alpine3.21 │ └── Dockerfile ├── alpine3.22 │ └── Dockerfile ├── alpine3.23 │ └── Dockerfile ├── bullseye │ ├── Dockerfile │ └── slim │ │ └── Dockerfile ├── bookworm │ ├── Dockerfile │ └── slim │ │ └── Dockerfile └── trixie │ ├── Dockerfile │ └── slim │ └── Dockerfile ├── README.md ├── LICENSE-APACHE └── x.py /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /versions.toml: -------------------------------------------------------------------------------- 1 | rust = "1.92.0" 2 | rustup = "1.28.2" 3 | -------------------------------------------------------------------------------- /Dockerfile-debian.template: -------------------------------------------------------------------------------- 1 | FROM buildpack-deps:%%TAG%% 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=%%RUST-VERSION%% 9 | 10 | RUN set -eux; \ 11 | \ 12 | %%ARCH-CASE%%; \ 13 | \ 14 | url="https://static.rust-lang.org/rustup/archive/%%RUSTUP-VERSION%%/${rustArch}/rustup-init"; \ 15 | wget --progress=dot:giga "$url"; \ 16 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 17 | \ 18 | chmod +x rustup-init; \ 19 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 20 | rm rustup-init; \ 21 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 22 | \ 23 | rustup --version; \ 24 | cargo --version; \ 25 | rustc --version; 26 | -------------------------------------------------------------------------------- /Dockerfile-alpine.template: -------------------------------------------------------------------------------- 1 | FROM alpine:%%TAG%% 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | RUN apk add --no-cache \ 6 | ca-certificates \ 7 | musl-dev \ 8 | gcc 9 | 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH \ 13 | RUST_VERSION=%%RUST-VERSION%% 14 | 15 | RUN set -eux; \ 16 | \ 17 | %%ARCH-CASE%%; \ 18 | \ 19 | url="https://static.rust-lang.org/rustup/archive/%%RUSTUP-VERSION%%/${rustArch}/rustup-init"; \ 20 | wget "$url"; \ 21 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 22 | \ 23 | chmod +x rustup-init; \ 24 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 25 | rm rustup-init; \ 26 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 27 | \ 28 | rustup --version; \ 29 | cargo --version; \ 30 | rustc --version; 31 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) The Rust Project Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /Dockerfile-slim.template: -------------------------------------------------------------------------------- 1 | FROM debian:%%TAG%%-slim 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=%%RUST-VERSION%% 9 | 10 | RUN set -eux; \ 11 | \ 12 | apt-get update; \ 13 | apt-get install -y --no-install-recommends \ 14 | ca-certificates \ 15 | gcc \ 16 | libc6-dev \ 17 | wget \ 18 | ; \ 19 | \ 20 | %%ARCH-CASE%%; \ 21 | \ 22 | url="https://static.rust-lang.org/rustup/archive/%%RUSTUP-VERSION%%/${rustArch}/rustup-init"; \ 23 | wget --progress=dot:giga "$url"; \ 24 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 25 | \ 26 | chmod +x rustup-init; \ 27 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 28 | rm rustup-init; \ 29 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 30 | \ 31 | apt-get remove -y --auto-remove \ 32 | wget \ 33 | ; \ 34 | rm -rf /var/lib/apt/lists/*; \ 35 | \ 36 | rustup --version; \ 37 | cargo --version; \ 38 | rustc --version; 39 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | permissions: 4 | contents: read 5 | 6 | on: 7 | pull_request: 8 | push: 9 | branches: 10 | - master 11 | 12 | defaults: 13 | run: 14 | shell: bash 15 | 16 | jobs: 17 | build: 18 | runs-on: ubuntu-latest 19 | env: 20 | #RUST_VERSION 21 | RUST_VERSION: 1.92.0 22 | #RUST_VERSION 23 | strategy: 24 | matrix: 25 | include: 26 | #VERSIONS 27 | - name: bullseye 28 | variant: bullseye 29 | - name: slim-bullseye 30 | variant: bullseye/slim 31 | - name: bookworm 32 | variant: bookworm 33 | - name: slim-bookworm 34 | variant: bookworm/slim 35 | - name: trixie 36 | variant: trixie 37 | - name: slim-trixie 38 | variant: trixie/slim 39 | - name: alpine3.20 40 | variant: alpine3.20 41 | - name: alpine3.21 42 | variant: alpine3.21 43 | - name: alpine3.22 44 | variant: alpine3.22 45 | - name: alpine3.23 46 | variant: alpine3.23 47 | #VERSIONS 48 | name: ${{ matrix.name }} 49 | steps: 50 | - uses: actions/checkout@v5 51 | - run: git clone https://github.com/docker-library/official-images.git ~/official-images 52 | - run: docker build -t rust:$RUST_VERSION-${{ matrix.name }} stable/${{ matrix.variant }} 53 | - run: ~/official-images/test/run.sh rust:$RUST_VERSION-${{ matrix.name }} 54 | - run: docker images 55 | -------------------------------------------------------------------------------- /nightly/alpine3.20/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.20 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | RUN apk add --no-cache \ 6 | ca-certificates \ 7 | musl-dev \ 8 | gcc 9 | 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH \ 13 | RUST_VERSION=nightly 14 | 15 | RUN set -eux; \ 16 | \ 17 | arch="$(apk --print-arch)"; \ 18 | case "$arch" in \ 19 | 'x86_64') \ 20 | rustArch='x86_64-unknown-linux-musl'; \ 21 | rustupSha256='e6599a1c7be58a2d8eaca66a80e0dc006d87bbcf780a58b7343d6e14c1605cb2'; \ 22 | ;; \ 23 | 'aarch64') \ 24 | rustArch='aarch64-unknown-linux-musl'; \ 25 | rustupSha256='a97c8f56d7462908695348dd8c71ea6740c138ce303715793a690503a94fc9a9'; \ 26 | ;; \ 27 | 'ppc64le') \ 28 | rustArch='powerpc64le-unknown-linux-musl'; \ 29 | rustupSha256='08423383d36362d93f8d85f208aa5004a7cef77b69b29fb779ba03ed0544e4f1'; \ 30 | ;; \ 31 | *) \ 32 | echo >&2 "unsupported architecture: $arch"; \ 33 | exit 1; \ 34 | ;; \ 35 | esac; \ 36 | \ 37 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 38 | wget "$url"; \ 39 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 40 | \ 41 | chmod +x rustup-init; \ 42 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 43 | rm rustup-init; \ 44 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 45 | \ 46 | rustup --version; \ 47 | cargo --version; \ 48 | rustc --version; 49 | -------------------------------------------------------------------------------- /nightly/alpine3.21/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.21 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | RUN apk add --no-cache \ 6 | ca-certificates \ 7 | musl-dev \ 8 | gcc 9 | 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH \ 13 | RUST_VERSION=nightly 14 | 15 | RUN set -eux; \ 16 | \ 17 | arch="$(apk --print-arch)"; \ 18 | case "$arch" in \ 19 | 'x86_64') \ 20 | rustArch='x86_64-unknown-linux-musl'; \ 21 | rustupSha256='e6599a1c7be58a2d8eaca66a80e0dc006d87bbcf780a58b7343d6e14c1605cb2'; \ 22 | ;; \ 23 | 'aarch64') \ 24 | rustArch='aarch64-unknown-linux-musl'; \ 25 | rustupSha256='a97c8f56d7462908695348dd8c71ea6740c138ce303715793a690503a94fc9a9'; \ 26 | ;; \ 27 | 'ppc64le') \ 28 | rustArch='powerpc64le-unknown-linux-musl'; \ 29 | rustupSha256='08423383d36362d93f8d85f208aa5004a7cef77b69b29fb779ba03ed0544e4f1'; \ 30 | ;; \ 31 | *) \ 32 | echo >&2 "unsupported architecture: $arch"; \ 33 | exit 1; \ 34 | ;; \ 35 | esac; \ 36 | \ 37 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 38 | wget "$url"; \ 39 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 40 | \ 41 | chmod +x rustup-init; \ 42 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 43 | rm rustup-init; \ 44 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 45 | \ 46 | rustup --version; \ 47 | cargo --version; \ 48 | rustc --version; 49 | -------------------------------------------------------------------------------- /nightly/alpine3.22/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.22 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | RUN apk add --no-cache \ 6 | ca-certificates \ 7 | musl-dev \ 8 | gcc 9 | 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH \ 13 | RUST_VERSION=nightly 14 | 15 | RUN set -eux; \ 16 | \ 17 | arch="$(apk --print-arch)"; \ 18 | case "$arch" in \ 19 | 'x86_64') \ 20 | rustArch='x86_64-unknown-linux-musl'; \ 21 | rustupSha256='e6599a1c7be58a2d8eaca66a80e0dc006d87bbcf780a58b7343d6e14c1605cb2'; \ 22 | ;; \ 23 | 'aarch64') \ 24 | rustArch='aarch64-unknown-linux-musl'; \ 25 | rustupSha256='a97c8f56d7462908695348dd8c71ea6740c138ce303715793a690503a94fc9a9'; \ 26 | ;; \ 27 | 'ppc64le') \ 28 | rustArch='powerpc64le-unknown-linux-musl'; \ 29 | rustupSha256='08423383d36362d93f8d85f208aa5004a7cef77b69b29fb779ba03ed0544e4f1'; \ 30 | ;; \ 31 | *) \ 32 | echo >&2 "unsupported architecture: $arch"; \ 33 | exit 1; \ 34 | ;; \ 35 | esac; \ 36 | \ 37 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 38 | wget "$url"; \ 39 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 40 | \ 41 | chmod +x rustup-init; \ 42 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 43 | rm rustup-init; \ 44 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 45 | \ 46 | rustup --version; \ 47 | cargo --version; \ 48 | rustc --version; 49 | -------------------------------------------------------------------------------- /nightly/alpine3.23/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.23 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | RUN apk add --no-cache \ 6 | ca-certificates \ 7 | musl-dev \ 8 | gcc 9 | 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH \ 13 | RUST_VERSION=nightly 14 | 15 | RUN set -eux; \ 16 | \ 17 | arch="$(apk --print-arch)"; \ 18 | case "$arch" in \ 19 | 'x86_64') \ 20 | rustArch='x86_64-unknown-linux-musl'; \ 21 | rustupSha256='e6599a1c7be58a2d8eaca66a80e0dc006d87bbcf780a58b7343d6e14c1605cb2'; \ 22 | ;; \ 23 | 'aarch64') \ 24 | rustArch='aarch64-unknown-linux-musl'; \ 25 | rustupSha256='a97c8f56d7462908695348dd8c71ea6740c138ce303715793a690503a94fc9a9'; \ 26 | ;; \ 27 | 'ppc64le') \ 28 | rustArch='powerpc64le-unknown-linux-musl'; \ 29 | rustupSha256='08423383d36362d93f8d85f208aa5004a7cef77b69b29fb779ba03ed0544e4f1'; \ 30 | ;; \ 31 | *) \ 32 | echo >&2 "unsupported architecture: $arch"; \ 33 | exit 1; \ 34 | ;; \ 35 | esac; \ 36 | \ 37 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 38 | wget "$url"; \ 39 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 40 | \ 41 | chmod +x rustup-init; \ 42 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 43 | rm rustup-init; \ 44 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 45 | \ 46 | rustup --version; \ 47 | cargo --version; \ 48 | rustc --version; 49 | -------------------------------------------------------------------------------- /stable/alpine3.20/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.20 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | RUN apk add --no-cache \ 6 | ca-certificates \ 7 | musl-dev \ 8 | gcc 9 | 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH \ 13 | RUST_VERSION=1.92.0 14 | 15 | RUN set -eux; \ 16 | \ 17 | arch="$(apk --print-arch)"; \ 18 | case "$arch" in \ 19 | 'x86_64') \ 20 | rustArch='x86_64-unknown-linux-musl'; \ 21 | rustupSha256='e6599a1c7be58a2d8eaca66a80e0dc006d87bbcf780a58b7343d6e14c1605cb2'; \ 22 | ;; \ 23 | 'aarch64') \ 24 | rustArch='aarch64-unknown-linux-musl'; \ 25 | rustupSha256='a97c8f56d7462908695348dd8c71ea6740c138ce303715793a690503a94fc9a9'; \ 26 | ;; \ 27 | 'ppc64le') \ 28 | rustArch='powerpc64le-unknown-linux-musl'; \ 29 | rustupSha256='08423383d36362d93f8d85f208aa5004a7cef77b69b29fb779ba03ed0544e4f1'; \ 30 | ;; \ 31 | *) \ 32 | echo >&2 "unsupported architecture: $arch"; \ 33 | exit 1; \ 34 | ;; \ 35 | esac; \ 36 | \ 37 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 38 | wget "$url"; \ 39 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 40 | \ 41 | chmod +x rustup-init; \ 42 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 43 | rm rustup-init; \ 44 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 45 | \ 46 | rustup --version; \ 47 | cargo --version; \ 48 | rustc --version; 49 | -------------------------------------------------------------------------------- /stable/alpine3.21/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.21 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | RUN apk add --no-cache \ 6 | ca-certificates \ 7 | musl-dev \ 8 | gcc 9 | 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH \ 13 | RUST_VERSION=1.92.0 14 | 15 | RUN set -eux; \ 16 | \ 17 | arch="$(apk --print-arch)"; \ 18 | case "$arch" in \ 19 | 'x86_64') \ 20 | rustArch='x86_64-unknown-linux-musl'; \ 21 | rustupSha256='e6599a1c7be58a2d8eaca66a80e0dc006d87bbcf780a58b7343d6e14c1605cb2'; \ 22 | ;; \ 23 | 'aarch64') \ 24 | rustArch='aarch64-unknown-linux-musl'; \ 25 | rustupSha256='a97c8f56d7462908695348dd8c71ea6740c138ce303715793a690503a94fc9a9'; \ 26 | ;; \ 27 | 'ppc64le') \ 28 | rustArch='powerpc64le-unknown-linux-musl'; \ 29 | rustupSha256='08423383d36362d93f8d85f208aa5004a7cef77b69b29fb779ba03ed0544e4f1'; \ 30 | ;; \ 31 | *) \ 32 | echo >&2 "unsupported architecture: $arch"; \ 33 | exit 1; \ 34 | ;; \ 35 | esac; \ 36 | \ 37 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 38 | wget "$url"; \ 39 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 40 | \ 41 | chmod +x rustup-init; \ 42 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 43 | rm rustup-init; \ 44 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 45 | \ 46 | rustup --version; \ 47 | cargo --version; \ 48 | rustc --version; 49 | -------------------------------------------------------------------------------- /stable/alpine3.22/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.22 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | RUN apk add --no-cache \ 6 | ca-certificates \ 7 | musl-dev \ 8 | gcc 9 | 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH \ 13 | RUST_VERSION=1.92.0 14 | 15 | RUN set -eux; \ 16 | \ 17 | arch="$(apk --print-arch)"; \ 18 | case "$arch" in \ 19 | 'x86_64') \ 20 | rustArch='x86_64-unknown-linux-musl'; \ 21 | rustupSha256='e6599a1c7be58a2d8eaca66a80e0dc006d87bbcf780a58b7343d6e14c1605cb2'; \ 22 | ;; \ 23 | 'aarch64') \ 24 | rustArch='aarch64-unknown-linux-musl'; \ 25 | rustupSha256='a97c8f56d7462908695348dd8c71ea6740c138ce303715793a690503a94fc9a9'; \ 26 | ;; \ 27 | 'ppc64le') \ 28 | rustArch='powerpc64le-unknown-linux-musl'; \ 29 | rustupSha256='08423383d36362d93f8d85f208aa5004a7cef77b69b29fb779ba03ed0544e4f1'; \ 30 | ;; \ 31 | *) \ 32 | echo >&2 "unsupported architecture: $arch"; \ 33 | exit 1; \ 34 | ;; \ 35 | esac; \ 36 | \ 37 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 38 | wget "$url"; \ 39 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 40 | \ 41 | chmod +x rustup-init; \ 42 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 43 | rm rustup-init; \ 44 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 45 | \ 46 | rustup --version; \ 47 | cargo --version; \ 48 | rustc --version; 49 | -------------------------------------------------------------------------------- /stable/alpine3.23/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.23 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | RUN apk add --no-cache \ 6 | ca-certificates \ 7 | musl-dev \ 8 | gcc 9 | 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH \ 13 | RUST_VERSION=1.92.0 14 | 15 | RUN set -eux; \ 16 | \ 17 | arch="$(apk --print-arch)"; \ 18 | case "$arch" in \ 19 | 'x86_64') \ 20 | rustArch='x86_64-unknown-linux-musl'; \ 21 | rustupSha256='e6599a1c7be58a2d8eaca66a80e0dc006d87bbcf780a58b7343d6e14c1605cb2'; \ 22 | ;; \ 23 | 'aarch64') \ 24 | rustArch='aarch64-unknown-linux-musl'; \ 25 | rustupSha256='a97c8f56d7462908695348dd8c71ea6740c138ce303715793a690503a94fc9a9'; \ 26 | ;; \ 27 | 'ppc64le') \ 28 | rustArch='powerpc64le-unknown-linux-musl'; \ 29 | rustupSha256='08423383d36362d93f8d85f208aa5004a7cef77b69b29fb779ba03ed0544e4f1'; \ 30 | ;; \ 31 | *) \ 32 | echo >&2 "unsupported architecture: $arch"; \ 33 | exit 1; \ 34 | ;; \ 35 | esac; \ 36 | \ 37 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 38 | wget "$url"; \ 39 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 40 | \ 41 | chmod +x rustup-init; \ 42 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 43 | rm rustup-init; \ 44 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 45 | \ 46 | rustup --version; \ 47 | cargo --version; \ 48 | rustc --version; 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # About this Repo 2 | 3 | This is the Git repo of the Docker [official image](https://docs.docker.com/docker-hub/official_repos/) for [rust](https://registry.hub.docker.com/_/rust/). See [the Docker Hub page](https://registry.hub.docker.com/_/rust/) for the full readme on how to use this Docker image and for information regarding contributing and issues. 4 | 5 | The full readme is generated over in [docker-library/docs](https://github.com/docker-library/docs), specifically in [docker-library/docs/rust](https://github.com/docker-library/docs/tree/master/rust). 6 | 7 | See a change merged here that doesn't show up on the Docker Hub yet? Check [the "library/rust" manifest file in the docker-library/official-images repo](https://github.com/docker-library/official-images/blob/master/library/rust), especially [PRs with the "library/rust" label on that repo](https://github.com/docker-library/official-images/labels/library%2Frust). For more information about the official images process, see the [docker-library/official-images readme](https://github.com/docker-library/official-images/blob/master/README.md). 8 | 9 | 10 | 11 | ## Nightly Toolchain 12 | 13 | An image tracking the Rust nightly toolchain is available via 14 | [`rustlang/rust:nightly`](https://hub.docker.com/r/rustlang/rust/). 15 | 16 | ## License 17 | 18 | Licensed under the Apache License, Version 2.0 or the MIT license 20 | , at your 21 | option. Files in the project may not be 22 | copied, modified, or distributed except according to those terms. 23 | -------------------------------------------------------------------------------- /stable/bullseye/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM buildpack-deps:bullseye 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=1.92.0 9 | 10 | RUN set -eux; \ 11 | \ 12 | arch="$(dpkg --print-architecture)"; \ 13 | case "$arch" in \ 14 | 'amd64') \ 15 | rustArch='x86_64-unknown-linux-gnu'; \ 16 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 17 | ;; \ 18 | 'armhf') \ 19 | rustArch='armv7-unknown-linux-gnueabihf'; \ 20 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 21 | ;; \ 22 | 'arm64') \ 23 | rustArch='aarch64-unknown-linux-gnu'; \ 24 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 25 | ;; \ 26 | 'i386') \ 27 | rustArch='i686-unknown-linux-gnu'; \ 28 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 29 | ;; \ 30 | *) \ 31 | echo >&2 "unsupported architecture: $arch"; \ 32 | exit 1; \ 33 | ;; \ 34 | esac; \ 35 | \ 36 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 37 | wget --progress=dot:giga "$url"; \ 38 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 39 | \ 40 | chmod +x rustup-init; \ 41 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 42 | rm rustup-init; \ 43 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 44 | \ 45 | rustup --version; \ 46 | cargo --version; \ 47 | rustc --version; 48 | -------------------------------------------------------------------------------- /nightly/bullseye/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM buildpack-deps:bullseye 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=nightly 9 | 10 | RUN set -eux; \ 11 | \ 12 | arch="$(dpkg --print-architecture)"; \ 13 | case "$arch" in \ 14 | 'amd64') \ 15 | rustArch='x86_64-unknown-linux-gnu'; \ 16 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 17 | ;; \ 18 | 'armhf') \ 19 | rustArch='armv7-unknown-linux-gnueabihf'; \ 20 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 21 | ;; \ 22 | 'arm64') \ 23 | rustArch='aarch64-unknown-linux-gnu'; \ 24 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 25 | ;; \ 26 | 'i386') \ 27 | rustArch='i686-unknown-linux-gnu'; \ 28 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 29 | ;; \ 30 | *) \ 31 | echo >&2 "unsupported architecture: $arch"; \ 32 | exit 1; \ 33 | ;; \ 34 | esac; \ 35 | \ 36 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 37 | wget --progress=dot:giga "$url"; \ 38 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 39 | \ 40 | chmod +x rustup-init; \ 41 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 42 | rm rustup-init; \ 43 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 44 | \ 45 | rustup --version; \ 46 | cargo --version; \ 47 | rustc --version; 48 | -------------------------------------------------------------------------------- /nightly/bullseye/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye-slim 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=nightly 9 | 10 | RUN set -eux; \ 11 | \ 12 | apt-get update; \ 13 | apt-get install -y --no-install-recommends \ 14 | ca-certificates \ 15 | gcc \ 16 | libc6-dev \ 17 | wget \ 18 | ; \ 19 | \ 20 | arch="$(dpkg --print-architecture)"; \ 21 | case "$arch" in \ 22 | 'amd64') \ 23 | rustArch='x86_64-unknown-linux-gnu'; \ 24 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 25 | ;; \ 26 | 'armhf') \ 27 | rustArch='armv7-unknown-linux-gnueabihf'; \ 28 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 29 | ;; \ 30 | 'arm64') \ 31 | rustArch='aarch64-unknown-linux-gnu'; \ 32 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 33 | ;; \ 34 | 'i386') \ 35 | rustArch='i686-unknown-linux-gnu'; \ 36 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 37 | ;; \ 38 | *) \ 39 | echo >&2 "unsupported architecture: $arch"; \ 40 | exit 1; \ 41 | ;; \ 42 | esac; \ 43 | \ 44 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 45 | wget --progress=dot:giga "$url"; \ 46 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 47 | \ 48 | chmod +x rustup-init; \ 49 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 50 | rm rustup-init; \ 51 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 52 | \ 53 | apt-get remove -y --auto-remove \ 54 | wget \ 55 | ; \ 56 | rm -rf /var/lib/apt/lists/*; \ 57 | \ 58 | rustup --version; \ 59 | cargo --version; \ 60 | rustc --version; 61 | -------------------------------------------------------------------------------- /stable/bullseye/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye-slim 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=1.92.0 9 | 10 | RUN set -eux; \ 11 | \ 12 | apt-get update; \ 13 | apt-get install -y --no-install-recommends \ 14 | ca-certificates \ 15 | gcc \ 16 | libc6-dev \ 17 | wget \ 18 | ; \ 19 | \ 20 | arch="$(dpkg --print-architecture)"; \ 21 | case "$arch" in \ 22 | 'amd64') \ 23 | rustArch='x86_64-unknown-linux-gnu'; \ 24 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 25 | ;; \ 26 | 'armhf') \ 27 | rustArch='armv7-unknown-linux-gnueabihf'; \ 28 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 29 | ;; \ 30 | 'arm64') \ 31 | rustArch='aarch64-unknown-linux-gnu'; \ 32 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 33 | ;; \ 34 | 'i386') \ 35 | rustArch='i686-unknown-linux-gnu'; \ 36 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 37 | ;; \ 38 | *) \ 39 | echo >&2 "unsupported architecture: $arch"; \ 40 | exit 1; \ 41 | ;; \ 42 | esac; \ 43 | \ 44 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 45 | wget --progress=dot:giga "$url"; \ 46 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 47 | \ 48 | chmod +x rustup-init; \ 49 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 50 | rm rustup-init; \ 51 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 52 | \ 53 | apt-get remove -y --auto-remove \ 54 | wget \ 55 | ; \ 56 | rm -rf /var/lib/apt/lists/*; \ 57 | \ 58 | rustup --version; \ 59 | cargo --version; \ 60 | rustc --version; 61 | -------------------------------------------------------------------------------- /stable/bookworm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM buildpack-deps:bookworm 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=1.92.0 9 | 10 | RUN set -eux; \ 11 | \ 12 | arch="$(dpkg --print-architecture)"; \ 13 | case "$arch" in \ 14 | 'amd64') \ 15 | rustArch='x86_64-unknown-linux-gnu'; \ 16 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 17 | ;; \ 18 | 'armhf') \ 19 | rustArch='armv7-unknown-linux-gnueabihf'; \ 20 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 21 | ;; \ 22 | 'arm64') \ 23 | rustArch='aarch64-unknown-linux-gnu'; \ 24 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 25 | ;; \ 26 | 'i386') \ 27 | rustArch='i686-unknown-linux-gnu'; \ 28 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 29 | ;; \ 30 | 'ppc64el') \ 31 | rustArch='powerpc64le-unknown-linux-gnu'; \ 32 | rustupSha256='acd89c42b47c93bd4266163a7b05d3f26287d5148413c0d47b2e8a7aa67c9dc0'; \ 33 | ;; \ 34 | 's390x') \ 35 | rustArch='s390x-unknown-linux-gnu'; \ 36 | rustupSha256='726b7fd5d8805e73eab4a024a2889f8859d5a44e36041abac0a2436a52d42572'; \ 37 | ;; \ 38 | *) \ 39 | echo >&2 "unsupported architecture: $arch"; \ 40 | exit 1; \ 41 | ;; \ 42 | esac; \ 43 | \ 44 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 45 | wget --progress=dot:giga "$url"; \ 46 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 47 | \ 48 | chmod +x rustup-init; \ 49 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 50 | rm rustup-init; \ 51 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 52 | \ 53 | rustup --version; \ 54 | cargo --version; \ 55 | rustc --version; 56 | -------------------------------------------------------------------------------- /nightly/bookworm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM buildpack-deps:bookworm 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=nightly 9 | 10 | RUN set -eux; \ 11 | \ 12 | arch="$(dpkg --print-architecture)"; \ 13 | case "$arch" in \ 14 | 'amd64') \ 15 | rustArch='x86_64-unknown-linux-gnu'; \ 16 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 17 | ;; \ 18 | 'armhf') \ 19 | rustArch='armv7-unknown-linux-gnueabihf'; \ 20 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 21 | ;; \ 22 | 'arm64') \ 23 | rustArch='aarch64-unknown-linux-gnu'; \ 24 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 25 | ;; \ 26 | 'i386') \ 27 | rustArch='i686-unknown-linux-gnu'; \ 28 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 29 | ;; \ 30 | 'ppc64el') \ 31 | rustArch='powerpc64le-unknown-linux-gnu'; \ 32 | rustupSha256='acd89c42b47c93bd4266163a7b05d3f26287d5148413c0d47b2e8a7aa67c9dc0'; \ 33 | ;; \ 34 | 's390x') \ 35 | rustArch='s390x-unknown-linux-gnu'; \ 36 | rustupSha256='726b7fd5d8805e73eab4a024a2889f8859d5a44e36041abac0a2436a52d42572'; \ 37 | ;; \ 38 | *) \ 39 | echo >&2 "unsupported architecture: $arch"; \ 40 | exit 1; \ 41 | ;; \ 42 | esac; \ 43 | \ 44 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 45 | wget --progress=dot:giga "$url"; \ 46 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 47 | \ 48 | chmod +x rustup-init; \ 49 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 50 | rm rustup-init; \ 51 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 52 | \ 53 | rustup --version; \ 54 | cargo --version; \ 55 | rustc --version; 56 | -------------------------------------------------------------------------------- /nightly/trixie/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM buildpack-deps:trixie 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=nightly 9 | 10 | RUN set -eux; \ 11 | \ 12 | arch="$(dpkg --print-architecture)"; \ 13 | case "$arch" in \ 14 | 'amd64') \ 15 | rustArch='x86_64-unknown-linux-gnu'; \ 16 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 17 | ;; \ 18 | 'armhf') \ 19 | rustArch='armv7-unknown-linux-gnueabihf'; \ 20 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 21 | ;; \ 22 | 'arm64') \ 23 | rustArch='aarch64-unknown-linux-gnu'; \ 24 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 25 | ;; \ 26 | 'i386') \ 27 | rustArch='i686-unknown-linux-gnu'; \ 28 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 29 | ;; \ 30 | 'ppc64el') \ 31 | rustArch='powerpc64le-unknown-linux-gnu'; \ 32 | rustupSha256='acd89c42b47c93bd4266163a7b05d3f26287d5148413c0d47b2e8a7aa67c9dc0'; \ 33 | ;; \ 34 | 's390x') \ 35 | rustArch='s390x-unknown-linux-gnu'; \ 36 | rustupSha256='726b7fd5d8805e73eab4a024a2889f8859d5a44e36041abac0a2436a52d42572'; \ 37 | ;; \ 38 | 'riscv64') \ 39 | rustArch='riscv64gc-unknown-linux-gnu'; \ 40 | rustupSha256='09e64cc1b7a3e99adaa15dd2d46a3aad9d44d71041e2a96100d165c98a8fd7a7'; \ 41 | ;; \ 42 | *) \ 43 | echo >&2 "unsupported architecture: $arch"; \ 44 | exit 1; \ 45 | ;; \ 46 | esac; \ 47 | \ 48 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 49 | wget --progress=dot:giga "$url"; \ 50 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 51 | \ 52 | chmod +x rustup-init; \ 53 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 54 | rm rustup-init; \ 55 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 56 | \ 57 | rustup --version; \ 58 | cargo --version; \ 59 | rustc --version; 60 | -------------------------------------------------------------------------------- /stable/trixie/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM buildpack-deps:trixie 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=1.92.0 9 | 10 | RUN set -eux; \ 11 | \ 12 | arch="$(dpkg --print-architecture)"; \ 13 | case "$arch" in \ 14 | 'amd64') \ 15 | rustArch='x86_64-unknown-linux-gnu'; \ 16 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 17 | ;; \ 18 | 'armhf') \ 19 | rustArch='armv7-unknown-linux-gnueabihf'; \ 20 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 21 | ;; \ 22 | 'arm64') \ 23 | rustArch='aarch64-unknown-linux-gnu'; \ 24 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 25 | ;; \ 26 | 'i386') \ 27 | rustArch='i686-unknown-linux-gnu'; \ 28 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 29 | ;; \ 30 | 'ppc64el') \ 31 | rustArch='powerpc64le-unknown-linux-gnu'; \ 32 | rustupSha256='acd89c42b47c93bd4266163a7b05d3f26287d5148413c0d47b2e8a7aa67c9dc0'; \ 33 | ;; \ 34 | 's390x') \ 35 | rustArch='s390x-unknown-linux-gnu'; \ 36 | rustupSha256='726b7fd5d8805e73eab4a024a2889f8859d5a44e36041abac0a2436a52d42572'; \ 37 | ;; \ 38 | 'riscv64') \ 39 | rustArch='riscv64gc-unknown-linux-gnu'; \ 40 | rustupSha256='09e64cc1b7a3e99adaa15dd2d46a3aad9d44d71041e2a96100d165c98a8fd7a7'; \ 41 | ;; \ 42 | *) \ 43 | echo >&2 "unsupported architecture: $arch"; \ 44 | exit 1; \ 45 | ;; \ 46 | esac; \ 47 | \ 48 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 49 | wget --progress=dot:giga "$url"; \ 50 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 51 | \ 52 | chmod +x rustup-init; \ 53 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 54 | rm rustup-init; \ 55 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 56 | \ 57 | rustup --version; \ 58 | cargo --version; \ 59 | rustc --version; 60 | -------------------------------------------------------------------------------- /nightly/bookworm/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bookworm-slim 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=nightly 9 | 10 | RUN set -eux; \ 11 | \ 12 | apt-get update; \ 13 | apt-get install -y --no-install-recommends \ 14 | ca-certificates \ 15 | gcc \ 16 | libc6-dev \ 17 | wget \ 18 | ; \ 19 | \ 20 | arch="$(dpkg --print-architecture)"; \ 21 | case "$arch" in \ 22 | 'amd64') \ 23 | rustArch='x86_64-unknown-linux-gnu'; \ 24 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 25 | ;; \ 26 | 'armhf') \ 27 | rustArch='armv7-unknown-linux-gnueabihf'; \ 28 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 29 | ;; \ 30 | 'arm64') \ 31 | rustArch='aarch64-unknown-linux-gnu'; \ 32 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 33 | ;; \ 34 | 'i386') \ 35 | rustArch='i686-unknown-linux-gnu'; \ 36 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 37 | ;; \ 38 | 'ppc64el') \ 39 | rustArch='powerpc64le-unknown-linux-gnu'; \ 40 | rustupSha256='acd89c42b47c93bd4266163a7b05d3f26287d5148413c0d47b2e8a7aa67c9dc0'; \ 41 | ;; \ 42 | 's390x') \ 43 | rustArch='s390x-unknown-linux-gnu'; \ 44 | rustupSha256='726b7fd5d8805e73eab4a024a2889f8859d5a44e36041abac0a2436a52d42572'; \ 45 | ;; \ 46 | *) \ 47 | echo >&2 "unsupported architecture: $arch"; \ 48 | exit 1; \ 49 | ;; \ 50 | esac; \ 51 | \ 52 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 53 | wget --progress=dot:giga "$url"; \ 54 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 55 | \ 56 | chmod +x rustup-init; \ 57 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 58 | rm rustup-init; \ 59 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 60 | \ 61 | apt-get remove -y --auto-remove \ 62 | wget \ 63 | ; \ 64 | rm -rf /var/lib/apt/lists/*; \ 65 | \ 66 | rustup --version; \ 67 | cargo --version; \ 68 | rustc --version; 69 | -------------------------------------------------------------------------------- /stable/bookworm/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bookworm-slim 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=1.92.0 9 | 10 | RUN set -eux; \ 11 | \ 12 | apt-get update; \ 13 | apt-get install -y --no-install-recommends \ 14 | ca-certificates \ 15 | gcc \ 16 | libc6-dev \ 17 | wget \ 18 | ; \ 19 | \ 20 | arch="$(dpkg --print-architecture)"; \ 21 | case "$arch" in \ 22 | 'amd64') \ 23 | rustArch='x86_64-unknown-linux-gnu'; \ 24 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 25 | ;; \ 26 | 'armhf') \ 27 | rustArch='armv7-unknown-linux-gnueabihf'; \ 28 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 29 | ;; \ 30 | 'arm64') \ 31 | rustArch='aarch64-unknown-linux-gnu'; \ 32 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 33 | ;; \ 34 | 'i386') \ 35 | rustArch='i686-unknown-linux-gnu'; \ 36 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 37 | ;; \ 38 | 'ppc64el') \ 39 | rustArch='powerpc64le-unknown-linux-gnu'; \ 40 | rustupSha256='acd89c42b47c93bd4266163a7b05d3f26287d5148413c0d47b2e8a7aa67c9dc0'; \ 41 | ;; \ 42 | 's390x') \ 43 | rustArch='s390x-unknown-linux-gnu'; \ 44 | rustupSha256='726b7fd5d8805e73eab4a024a2889f8859d5a44e36041abac0a2436a52d42572'; \ 45 | ;; \ 46 | *) \ 47 | echo >&2 "unsupported architecture: $arch"; \ 48 | exit 1; \ 49 | ;; \ 50 | esac; \ 51 | \ 52 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 53 | wget --progress=dot:giga "$url"; \ 54 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 55 | \ 56 | chmod +x rustup-init; \ 57 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 58 | rm rustup-init; \ 59 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 60 | \ 61 | apt-get remove -y --auto-remove \ 62 | wget \ 63 | ; \ 64 | rm -rf /var/lib/apt/lists/*; \ 65 | \ 66 | rustup --version; \ 67 | cargo --version; \ 68 | rustc --version; 69 | -------------------------------------------------------------------------------- /stable/trixie/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:trixie-slim 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=1.92.0 9 | 10 | RUN set -eux; \ 11 | \ 12 | apt-get update; \ 13 | apt-get install -y --no-install-recommends \ 14 | ca-certificates \ 15 | gcc \ 16 | libc6-dev \ 17 | wget \ 18 | ; \ 19 | \ 20 | arch="$(dpkg --print-architecture)"; \ 21 | case "$arch" in \ 22 | 'amd64') \ 23 | rustArch='x86_64-unknown-linux-gnu'; \ 24 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 25 | ;; \ 26 | 'armhf') \ 27 | rustArch='armv7-unknown-linux-gnueabihf'; \ 28 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 29 | ;; \ 30 | 'arm64') \ 31 | rustArch='aarch64-unknown-linux-gnu'; \ 32 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 33 | ;; \ 34 | 'i386') \ 35 | rustArch='i686-unknown-linux-gnu'; \ 36 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 37 | ;; \ 38 | 'ppc64el') \ 39 | rustArch='powerpc64le-unknown-linux-gnu'; \ 40 | rustupSha256='acd89c42b47c93bd4266163a7b05d3f26287d5148413c0d47b2e8a7aa67c9dc0'; \ 41 | ;; \ 42 | 's390x') \ 43 | rustArch='s390x-unknown-linux-gnu'; \ 44 | rustupSha256='726b7fd5d8805e73eab4a024a2889f8859d5a44e36041abac0a2436a52d42572'; \ 45 | ;; \ 46 | 'riscv64') \ 47 | rustArch='riscv64gc-unknown-linux-gnu'; \ 48 | rustupSha256='09e64cc1b7a3e99adaa15dd2d46a3aad9d44d71041e2a96100d165c98a8fd7a7'; \ 49 | ;; \ 50 | *) \ 51 | echo >&2 "unsupported architecture: $arch"; \ 52 | exit 1; \ 53 | ;; \ 54 | esac; \ 55 | \ 56 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 57 | wget --progress=dot:giga "$url"; \ 58 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 59 | \ 60 | chmod +x rustup-init; \ 61 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 62 | rm rustup-init; \ 63 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 64 | \ 65 | apt-get remove -y --auto-remove \ 66 | wget \ 67 | ; \ 68 | rm -rf /var/lib/apt/lists/*; \ 69 | \ 70 | rustup --version; \ 71 | cargo --version; \ 72 | rustc --version; 73 | -------------------------------------------------------------------------------- /nightly/trixie/slim/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:trixie-slim 2 | 3 | LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust 4 | 5 | ENV RUSTUP_HOME=/usr/local/rustup \ 6 | CARGO_HOME=/usr/local/cargo \ 7 | PATH=/usr/local/cargo/bin:$PATH \ 8 | RUST_VERSION=nightly 9 | 10 | RUN set -eux; \ 11 | \ 12 | apt-get update; \ 13 | apt-get install -y --no-install-recommends \ 14 | ca-certificates \ 15 | gcc \ 16 | libc6-dev \ 17 | wget \ 18 | ; \ 19 | \ 20 | arch="$(dpkg --print-architecture)"; \ 21 | case "$arch" in \ 22 | 'amd64') \ 23 | rustArch='x86_64-unknown-linux-gnu'; \ 24 | rustupSha256='20a06e644b0d9bd2fbdbfd52d42540bdde820ea7df86e92e533c073da0cdd43c'; \ 25 | ;; \ 26 | 'armhf') \ 27 | rustArch='armv7-unknown-linux-gnueabihf'; \ 28 | rustupSha256='3b8daab6cc3135f2cd4b12919559e6adaee73a2fbefb830fadf0405c20231d61'; \ 29 | ;; \ 30 | 'arm64') \ 31 | rustArch='aarch64-unknown-linux-gnu'; \ 32 | rustupSha256='e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c'; \ 33 | ;; \ 34 | 'i386') \ 35 | rustArch='i686-unknown-linux-gnu'; \ 36 | rustupSha256='a5db2c4b29d23e9b318b955dd0337d6b52e93933608469085c924e0d05b1df1f'; \ 37 | ;; \ 38 | 'ppc64el') \ 39 | rustArch='powerpc64le-unknown-linux-gnu'; \ 40 | rustupSha256='acd89c42b47c93bd4266163a7b05d3f26287d5148413c0d47b2e8a7aa67c9dc0'; \ 41 | ;; \ 42 | 's390x') \ 43 | rustArch='s390x-unknown-linux-gnu'; \ 44 | rustupSha256='726b7fd5d8805e73eab4a024a2889f8859d5a44e36041abac0a2436a52d42572'; \ 45 | ;; \ 46 | 'riscv64') \ 47 | rustArch='riscv64gc-unknown-linux-gnu'; \ 48 | rustupSha256='09e64cc1b7a3e99adaa15dd2d46a3aad9d44d71041e2a96100d165c98a8fd7a7'; \ 49 | ;; \ 50 | *) \ 51 | echo >&2 "unsupported architecture: $arch"; \ 52 | exit 1; \ 53 | ;; \ 54 | esac; \ 55 | \ 56 | url="https://static.rust-lang.org/rustup/archive/1.28.2/${rustArch}/rustup-init"; \ 57 | wget --progress=dot:giga "$url"; \ 58 | echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ 59 | \ 60 | chmod +x rustup-init; \ 61 | ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ 62 | rm rustup-init; \ 63 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 64 | \ 65 | apt-get remove -y --auto-remove \ 66 | wget \ 67 | ; \ 68 | rm -rf /var/lib/apt/lists/*; \ 69 | \ 70 | rustup --version; \ 71 | cargo --version; \ 72 | rustc --version; 73 | -------------------------------------------------------------------------------- /.github/workflows/nightly.yml: -------------------------------------------------------------------------------- 1 | name: Nightly Publish 2 | 3 | permissions: 4 | contents: read 5 | packages: write 6 | 7 | on: 8 | push: 9 | branches: 10 | - master 11 | pull_request: 12 | branches: 13 | - master 14 | schedule: 15 | - cron: '0 0 * * *' 16 | 17 | jobs: 18 | build: 19 | runs-on: ubuntu-latest 20 | strategy: 21 | matrix: 22 | include: 23 | #VERSIONS 24 | - name: bullseye 25 | context: nightly/bullseye 26 | platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/386 27 | tags: | 28 | nightly-bullseye 29 | - name: slim-bullseye 30 | context: nightly/bullseye/slim 31 | platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/386 32 | tags: | 33 | nightly-bullseye-slim 34 | - name: bookworm 35 | context: nightly/bookworm 36 | platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le,linux/s390x 37 | tags: | 38 | nightly-bookworm 39 | - name: slim-bookworm 40 | context: nightly/bookworm/slim 41 | platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le,linux/s390x 42 | tags: | 43 | nightly-bookworm-slim 44 | - name: trixie 45 | context: nightly/trixie 46 | platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le,linux/s390x,linux/riscv64 47 | tags: | 48 | nightly-trixie 49 | nightly 50 | - name: slim-trixie 51 | context: nightly/trixie/slim 52 | platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le,linux/s390x,linux/riscv64 53 | tags: | 54 | nightly-trixie-slim 55 | nightly-slim 56 | - name: alpine3.20 57 | context: nightly/alpine3.20 58 | platforms: linux/amd64,linux/arm64,linux/ppc64le 59 | tags: | 60 | nightly-alpine3.20 61 | - name: alpine3.21 62 | context: nightly/alpine3.21 63 | platforms: linux/amd64,linux/arm64,linux/ppc64le 64 | tags: | 65 | nightly-alpine3.21 66 | - name: alpine3.22 67 | context: nightly/alpine3.22 68 | platforms: linux/amd64,linux/arm64,linux/ppc64le 69 | tags: | 70 | nightly-alpine3.22 71 | - name: alpine3.23 72 | context: nightly/alpine3.23 73 | platforms: linux/amd64,linux/arm64,linux/ppc64le 74 | tags: | 75 | nightly-alpine3.23 76 | nightly-alpine 77 | #VERSIONS 78 | name: ${{ matrix.name }} 79 | steps: 80 | - name: Checkout repository 81 | uses: actions/checkout@v5 82 | - name: Set up QEMU 83 | uses: docker/setup-qemu-action@v3 84 | - name: Set up Docker Buildx 85 | uses: docker/setup-buildx-action@v3 86 | - name: Login to GHCR 87 | uses: docker/login-action@v3 88 | if: github.event_name != 'pull_request' 89 | with: 90 | registry: ghcr.io 91 | username: rust-lang 92 | password: ${{ secrets.GITHUB_TOKEN }} 93 | 94 | - name: Login to Docker Hub 95 | uses: docker/login-action@v3 96 | if: github.event_name != 'pull_request' 97 | with: 98 | username: rustopsbot 99 | password: ${{ secrets.DOCKER_HUB_TOKEN }} 100 | 101 | - name: Docker Metadata 102 | id: meta 103 | uses: docker/metadata-action@v5 104 | with: 105 | images: | 106 | rustlang/rust 107 | ghcr.io/rust-lang/rust 108 | tags: ${{ matrix.tags }} 109 | 110 | - name: Build and push image 111 | uses: docker/build-push-action@v6 112 | with: 113 | context: ${{ matrix.context }} 114 | platforms: ${{ matrix.platforms }} 115 | push: ${{ github.event_name != 'pull_request' }} 116 | tags: ${{ steps.meta.outputs.tags }} 117 | labels: ${{ steps.meta.outputs.labels }} 118 | -------------------------------------------------------------------------------- /.github/workflows/mirror_stable.yml: -------------------------------------------------------------------------------- 1 | name: Mirror Stable Images to GHCR 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | # Run daily at midnight UTC 7 | - cron: '0 0 * * *' 8 | 9 | jobs: 10 | mirror: 11 | name: DockerHub mirror 12 | runs-on: ubuntu-24.04 13 | if: github.repository == 'rust-lang/docker-rust' 14 | permissions: 15 | contents: read 16 | # Needed to write to the ghcr.io registry 17 | packages: write 18 | strategy: 19 | matrix: 20 | include: 21 | #VERSIONS 22 | - name: alpine3.20 23 | tags: | 24 | 1-alpine3.20 25 | 1.92-alpine3.20 26 | 1.92.0-alpine3.20 27 | alpine3.20 28 | - name: alpine3.21 29 | tags: | 30 | 1-alpine3.21 31 | 1.92-alpine3.21 32 | 1.92.0-alpine3.21 33 | alpine3.21 34 | - name: alpine3.22 35 | tags: | 36 | 1-alpine3.22 37 | 1.92-alpine3.22 38 | 1.92.0-alpine3.22 39 | alpine3.22 40 | - name: alpine3.23 41 | tags: | 42 | 1-alpine3.23 43 | 1.92-alpine3.23 44 | 1.92.0-alpine3.23 45 | alpine3.23 46 | 1-alpine 47 | 1.92-alpine 48 | 1.92.0-alpine 49 | alpine 50 | - name: bullseye 51 | tags: | 52 | 1-bullseye 53 | 1.92-bullseye 54 | 1.92.0-bullseye 55 | bullseye 56 | - name: slim-bullseye 57 | tags: | 58 | 1-slim-bullseye 59 | 1.92-slim-bullseye 60 | 1.92.0-slim-bullseye 61 | slim-bullseye 62 | - name: bookworm 63 | tags: | 64 | 1-bookworm 65 | 1.92-bookworm 66 | 1.92.0-bookworm 67 | bookworm 68 | - name: slim-bookworm 69 | tags: | 70 | 1-slim-bookworm 71 | 1.92-slim-bookworm 72 | 1.92.0-slim-bookworm 73 | slim-bookworm 74 | - name: trixie 75 | tags: | 76 | 1-trixie 77 | 1.92-trixie 78 | 1.92.0-trixie 79 | trixie 80 | 1 81 | 1.92 82 | 1.92.0 83 | latest 84 | - name: slim-trixie 85 | tags: | 86 | 1-slim-trixie 87 | 1.92-slim-trixie 88 | 1.92.0-slim-trixie 89 | slim-trixie 90 | 1-slim 91 | 1.92-slim 92 | 1.92.0-slim 93 | slim 94 | #VERSIONS 95 | steps: 96 | - uses: actions/checkout@v5 97 | with: 98 | persist-credentials: false 99 | 100 | - name: Login to Docker Hub 101 | uses: docker/login-action@v3 102 | with: 103 | username: rustopsbot 104 | password: ${{ secrets.DOCKER_HUB_TOKEN }} 105 | 106 | - name: Login to GHCR 107 | uses: docker/login-action@v3 108 | with: 109 | registry: ghcr.io 110 | username: ${{ github.repository_owner }} 111 | password: ${{ secrets.GITHUB_TOKEN }} 112 | 113 | # Download crane in the current directory. 114 | # We use crane because it copies the docker image for all the architectures available in 115 | # DockerHub for the image. 116 | # Learn more about crane at 117 | # https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md 118 | - name: Download crane 119 | run: | 120 | curl -sL "https://github.com/google/go-containerregistry/releases/download/${VERSION}/go-containerregistry_${OS}_${ARCH}.tar.gz" | tar -xzf - 121 | env: 122 | VERSION: v0.20.2 123 | OS: Linux 124 | ARCH: x86_64 125 | 126 | - name: Copy image to GHCR 127 | run: | 128 | ./crane copy "docker.io/rust:${{ matrix.name }}" "ghcr.io/${{ github.repository_owner }}/rust:${{ matrix.name }}" 129 | readarray -t TAGS <<< "${{ matrix.tags }}" 130 | for tag in "${TAGS[@]}"; do 131 | if [ -n "$tag" ]; then 132 | ./crane tag "ghcr.io/${{ github.repository_owner }}/rust:${{ matrix.name }}" "${tag}" 133 | fi 134 | done 135 | 136 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /x.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | from collections import namedtuple 5 | from urllib import request 6 | import os 7 | import subprocess 8 | import tomllib 9 | 10 | def load_versions(): 11 | with open("versions.toml", "rb") as f: 12 | versions = tomllib.load(f) 13 | rust_version = versions['rust'] 14 | rustup_version = versions['rustup'] 15 | return rust_version, rustup_version 16 | 17 | def write_versions(rust_version, rustup_version): 18 | with open("versions.toml", "w") as f: 19 | f.write(f'rust = "{rust_version}"\n') 20 | f.write(f'rustup = "{rustup_version}"\n') 21 | 22 | rust_version, rustup_version = load_versions() 23 | Channel = namedtuple("Channel", ["name", "rust_version"]) 24 | stable = Channel("stable", rust_version) 25 | nightly = Channel("nightly", "nightly") 26 | supported_channels = [ 27 | stable, 28 | nightly 29 | ] 30 | 31 | DebianArch = namedtuple("DebianArch", ["bashbrew", "dpkg", "qemu", "rust"]) 32 | 33 | debian_lts_arches = [ 34 | DebianArch("amd64", "amd64", "linux/amd64", "x86_64-unknown-linux-gnu"), 35 | DebianArch("arm32v7", "armhf", "linux/arm/v7", "armv7-unknown-linux-gnueabihf"), 36 | DebianArch("arm64v8", "arm64", "linux/arm64", "aarch64-unknown-linux-gnu"), 37 | DebianArch("i386", "i386", "linux/386", "i686-unknown-linux-gnu"), 38 | ] 39 | 40 | debian_non_lts_arches = [ 41 | DebianArch("ppc64le", "ppc64el", "linux/ppc64le", "powerpc64le-unknown-linux-gnu"), 42 | DebianArch("s390x", "s390x", "linux/s390x", "s390x-unknown-linux-gnu"), 43 | ] 44 | 45 | debian_trixie_arches = [ 46 | DebianArch("riscv64", "riscv64", "linux/riscv64", "riscv64gc-unknown-linux-gnu"), 47 | ] 48 | 49 | latest_debian_release = "trixie" 50 | 51 | DebianRelease = namedtuple("DebianRelease", ["name", "arches"]) 52 | 53 | debian_releases = [ 54 | DebianRelease("bullseye", debian_lts_arches), 55 | DebianRelease("bookworm", debian_lts_arches + debian_non_lts_arches), 56 | DebianRelease(latest_debian_release, debian_lts_arches + debian_non_lts_arches + debian_trixie_arches), 57 | ] 58 | 59 | AlpineArch = namedtuple("AlpineArch", ["bashbrew", "apk", "qemu", "rust"]) 60 | 61 | alpine_arches = [ 62 | AlpineArch("amd64", "x86_64", "linux/amd64", "x86_64-unknown-linux-musl"), 63 | AlpineArch("arm64v8", "aarch64", "linux/arm64", "aarch64-unknown-linux-musl"), 64 | AlpineArch("ppc64le", "ppc64le", "linux/ppc64le", "powerpc64le-unknown-linux-musl"), 65 | ] 66 | 67 | latest_alpine_version = "3.23" 68 | alpine_versions = [ 69 | "3.20", 70 | "3.21", 71 | "3.22", 72 | latest_alpine_version, 73 | ] 74 | 75 | def rustup_hash(arch): 76 | url = f"https://static.rust-lang.org/rustup/archive/{rustup_version}/{arch}/rustup-init.sha256" 77 | with request.urlopen(url) as f: 78 | return f.read().decode('utf-8').split()[0] 79 | 80 | def read_file(file): 81 | with open(file, "r") as f: 82 | return f.read() 83 | 84 | def write_file(file, contents): 85 | dir = os.path.dirname(file) 86 | if dir and not os.path.exists(dir): 87 | os.makedirs(dir) 88 | with open(file, "w") as f: 89 | f.write(contents) 90 | 91 | def update_debian(): 92 | for release in debian_releases: 93 | arch_cases_str = arch_cases_start("$(dpkg --print-architecture)") 94 | for debian_arch in release.arches: 95 | arch_cases_str += arch_case(debian_arch.dpkg, debian_arch.rust) 96 | arch_cases_str += arch_cases_end() 97 | 98 | for channel in supported_channels: 99 | render_template( 100 | "Dockerfile-debian.template", 101 | channel.rust_version, 102 | release.name, 103 | arch_cases_str, 104 | f"{channel.name}/{release.name}/Dockerfile", 105 | ) 106 | 107 | render_template( 108 | "Dockerfile-slim.template", 109 | channel.rust_version, 110 | release.name, 111 | arch_cases_str, 112 | f"{channel.name}/{release.name}/slim/Dockerfile", 113 | ) 114 | 115 | def update_alpine(): 116 | arch_cases_str = arch_cases_start("$(apk --print-arch)") 117 | for arch in alpine_arches: 118 | arch_cases_str += arch_case(arch.apk, arch.rust) 119 | arch_cases_str += arch_cases_end() 120 | 121 | for version in alpine_versions: 122 | for channel in supported_channels: 123 | render_template( 124 | "Dockerfile-alpine.template", 125 | channel.rust_version, 126 | version, 127 | arch_cases_str, 128 | f"{channel.name}/alpine{version}/Dockerfile", 129 | ) 130 | 131 | def arch_cases_start(arch_cmd): 132 | start = f'arch="{arch_cmd}"; \\\n' 133 | start += ' case "$arch" in \\\n' 134 | return start 135 | 136 | def arch_cases_end(): 137 | end = '' 138 | end += ' *) \\\n' 139 | end += ' echo >&2 "unsupported architecture: $arch"; \\\n' 140 | end += ' exit 1; \\\n' 141 | end += ' ;; \\\n' 142 | end += ' esac' 143 | return end 144 | 145 | def arch_case(distro_arch, rust_arch): 146 | rustup_sha256 = rustup_hash(rust_arch) 147 | arch_case_str = f" '{distro_arch}') \\\n" 148 | arch_case_str += f" rustArch='{rust_arch}'; \\\n" 149 | arch_case_str += f" rustupSha256='{rustup_sha256}'; \\\n" 150 | arch_case_str += " ;; \\\n" 151 | return arch_case_str 152 | 153 | def render_template( 154 | template_path, 155 | rust_version, 156 | docker_tag, 157 | arch_cases, 158 | rendered_path 159 | ): 160 | template = read_file(template_path) 161 | rendered = template \ 162 | .replace("%%TAG%%", docker_tag) \ 163 | .replace("%%RUST-VERSION%%", rust_version) \ 164 | .replace("%%RUSTUP-VERSION%%", rustup_version) \ 165 | .replace("%%ARCH-CASE%%", arch_cases) 166 | write_file(rendered_path, rendered) 167 | 168 | def update_ci(): 169 | file = ".github/workflows/ci.yml" 170 | config = read_file(file) 171 | 172 | marker = "#RUST_VERSION\n" 173 | split = config.split(marker) 174 | rendered = split[0] + marker + f" RUST_VERSION: {stable.rust_version}\n" + marker + split[2] 175 | 176 | versions = "" 177 | for release in debian_releases: 178 | versions += f" - name: {release.name}\n" 179 | versions += f" variant: {release.name}\n" 180 | versions += f" - name: slim-{release.name}\n" 181 | versions += f" variant: {release.name}/slim\n" 182 | 183 | for version in alpine_versions: 184 | versions += f" - name: alpine{version}\n" 185 | versions += f" variant: alpine{version}\n" 186 | 187 | marker = "#VERSIONS\n" 188 | split = rendered.split(marker) 189 | rendered = split[0] + marker + versions + marker + split[2] 190 | write_file(file, rendered) 191 | 192 | def update_mirror_stable_ci(): 193 | file = ".github/workflows/mirror_stable.yml" 194 | config = read_file(file) 195 | 196 | versions = "" 197 | for version in alpine_versions: 198 | tags = [] 199 | for version_tag in version_tags(): 200 | tags.append(f"{version_tag}-alpine{version}") 201 | tags.append(f"alpine{version}") 202 | if version == latest_alpine_version: 203 | for version_tag in version_tags(): 204 | tags.append(f"{version_tag}-alpine") 205 | tags.append("alpine") 206 | 207 | versions += f" - name: alpine{version}\n" 208 | versions += " tags: |\n" 209 | for tag in tags: 210 | versions += f" {tag}\n" 211 | 212 | for release in debian_releases: 213 | tags = [] 214 | for version_tag in version_tags(): 215 | tags.append(f"{version_tag}-{release.name}") 216 | tags.append(release.name) 217 | if release.name == latest_debian_release: 218 | for version_tag in version_tags(): 219 | tags.append(version_tag) 220 | tags.append("latest") 221 | 222 | versions += f" - name: {release.name}\n" 223 | versions += " tags: |\n" 224 | for tag in tags: 225 | versions += f" {tag}\n" 226 | 227 | tags = [] 228 | for version_tag in version_tags(): 229 | tags.append(f"{version_tag}-slim-{release.name}") 230 | tags.append(f"slim-{release.name}") 231 | if release.name == latest_debian_release: 232 | for version_tag in version_tags(): 233 | tags.append(f"{version_tag}-slim") 234 | tags.append("slim") 235 | 236 | versions += f" - name: slim-{release.name}\n" 237 | versions += " tags: |\n" 238 | for tag in tags: 239 | versions += f" {tag}\n" 240 | 241 | marker = "#VERSIONS\n" 242 | split = config.split(marker) 243 | rendered = split[0] + marker + versions + marker + split[2] 244 | write_file(file, rendered) 245 | 246 | 247 | def update_nightly_ci(): 248 | file = ".github/workflows/nightly.yml" 249 | config = read_file(file) 250 | 251 | 252 | versions = "" 253 | for release in debian_releases: 254 | platforms = [] 255 | for arch in release.arches: 256 | platforms.append(f"{arch.qemu}") 257 | platforms = ",".join(platforms) 258 | 259 | tags = [f"nightly-{release.name}"] 260 | if release.name == latest_debian_release: 261 | tags.append("nightly") 262 | 263 | versions += f" - name: {release.name}\n" 264 | versions += f" context: nightly/{release.name}\n" 265 | versions += f" platforms: {platforms}\n" 266 | versions += " tags: |\n" 267 | for tag in tags: 268 | versions += f" {tag}\n" 269 | 270 | versions += f" - name: slim-{release.name}\n" 271 | versions += f" context: nightly/{release.name}/slim\n" 272 | versions += f" platforms: {platforms}\n" 273 | versions += " tags: |\n" 274 | for tag in tags: 275 | versions += f" {tag}-slim\n" 276 | 277 | for version in alpine_versions: 278 | platforms = [] 279 | for arch in alpine_arches: 280 | platforms.append(f"{arch.qemu}") 281 | platforms = ",".join(platforms) 282 | 283 | tags = [f"nightly-alpine{version}"] 284 | if version == latest_alpine_version: 285 | tags.append("nightly-alpine") 286 | 287 | versions += f" - name: alpine{version}\n" 288 | versions += f" context: nightly/alpine{version}\n" 289 | versions += f" platforms: {platforms}\n" 290 | versions += " tags: |\n" 291 | for tag in tags: 292 | versions += f" {tag}\n" 293 | 294 | marker = "#VERSIONS\n" 295 | split = config.split(marker) 296 | rendered = split[0] + marker + versions + marker + split[2] 297 | write_file(file, rendered) 298 | 299 | def file_commit(file): 300 | return subprocess.run( 301 | ["git", "log", "-1", "--format=%H", "HEAD", "--", file], 302 | capture_output = True) \ 303 | .stdout \ 304 | .decode('utf-8') \ 305 | .strip() 306 | 307 | def version_tags(): 308 | parts = stable.rust_version.split(".") 309 | tags = [] 310 | for i in range(len(parts)): 311 | tags.append(".".join(parts[:i + 1])) 312 | return tags 313 | 314 | def single_library(tags, architectures, dir): 315 | return f""" 316 | Tags: {", ".join(tags)} 317 | Architectures: {", ".join(architectures)} 318 | GitCommit: {file_commit(os.path.join(dir, "Dockerfile"))} 319 | Directory: {dir} 320 | """ 321 | 322 | def generate_stackbrew_library(): 323 | commit = file_commit("x.py") 324 | 325 | library = f"""\ 326 | # this file is generated via https://github.com/rust-lang/docker-rust/blob/{commit}/x.py 327 | 328 | Maintainers: Steven Fackler (@sfackler), 329 | Scott Schafer (@Muscraft), 330 | Jakub Beránek (@kobzol) 331 | GitRepo: https://github.com/rust-lang/docker-rust.git 332 | """ 333 | 334 | for release in debian_releases: 335 | tags = [] 336 | for version_tag in version_tags(): 337 | tags.append(f"{version_tag}-{release.name}") 338 | tags.append(release.name) 339 | if release.name == latest_debian_release: 340 | for version_tag in version_tags(): 341 | tags.append(version_tag) 342 | tags.append("latest") 343 | 344 | arches = release.arches[:] 345 | 346 | library += single_library( 347 | tags, 348 | map(lambda a: a.bashbrew, arches), 349 | os.path.join(stable.name, release.name)) 350 | 351 | tags = [] 352 | for version_tag in version_tags(): 353 | tags.append(f"{version_tag}-slim-{release.name}") 354 | tags.append(f"slim-{release.name}") 355 | if release.name == latest_debian_release: 356 | for version_tag in version_tags(): 357 | tags.append(f"{version_tag}-slim") 358 | tags.append("slim") 359 | 360 | library += single_library( 361 | tags, 362 | map(lambda a: a.bashbrew, arches), 363 | os.path.join(stable.name, release.name, "slim")) 364 | 365 | for version in alpine_versions: 366 | tags = [] 367 | for version_tag in version_tags(): 368 | tags.append(f"{version_tag}-alpine{version}") 369 | tags.append(f"alpine{version}") 370 | if version == latest_alpine_version: 371 | for version_tag in version_tags(): 372 | tags.append(f"{version_tag}-alpine") 373 | tags.append("alpine") 374 | 375 | library += single_library( 376 | tags, 377 | map(lambda a: a.bashbrew, alpine_arches), 378 | os.path.join(stable.name, f"alpine{version}")) 379 | 380 | print(library) 381 | 382 | if __name__ == "__main__": 383 | parser = argparse.ArgumentParser() 384 | subparsers = parser.add_subparsers(dest='subcommand', required=True) 385 | 386 | update_parser = subparsers.add_parser('update') 387 | update_parser.add_argument('--rust', metavar='VERSION', dest='rust', action='store') 388 | update_parser.add_argument('--rustup', metavar='VERSION', dest='rustup', action='store') 389 | 390 | generate_stackbrew_library_parser = subparsers.add_parser('generate-stackbrew-library') 391 | 392 | args = parser.parse_args() 393 | if args.subcommand == "update": 394 | if args.rust: 395 | rust_version = args.rust 396 | stable = Channel("stable", rust_version) 397 | write_versions(rust_version, rustup_version) 398 | 399 | if args.rustup: 400 | rustup_version = args.rustup 401 | write_versions(rust_version, rustup_version) 402 | 403 | update_debian() 404 | update_alpine() 405 | update_ci() 406 | update_mirror_stable_ci() 407 | update_nightly_ci() 408 | elif args.subcommand == "generate-stackbrew-library": 409 | generate_stackbrew_library() 410 | --------------------------------------------------------------------------------