├── .github └── workflows │ └── build.yml ├── README.md ├── alpine └── Dockerfile ├── debian-slim └── Dockerfile └── debian └── Dockerfile /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | schedule: 11 | - cron: '0 0 * * *' 12 | 13 | jobs: 14 | trigger: 15 | strategy: 16 | matrix: 17 | include: 18 | - context: alpine 19 | args: | 20 | ALPINE_VERSION=3.17 21 | tags: | 22 | nightly-alpine3.17 23 | nightly-alpine 24 | - context: alpine 25 | args: | 26 | ALPINE_VERSION=3.16 27 | tags: | 28 | nightly-alpine3.16 29 | - context: debian 30 | args: | 31 | DEBIAN_VERSION=bookworm 32 | tags: | 33 | nightly-bookworm 34 | - context: debian 35 | args: | 36 | DEBIAN_VERSION=bullseye 37 | tags: | 38 | nightly 39 | nightly-bullseye 40 | - context: debian 41 | args: | 42 | DEBIAN_VERSION=buster 43 | tags: | 44 | nightly-buster 45 | - context: debian-slim 46 | args: | 47 | DEBIAN_VERSION=bookworm 48 | tags: | 49 | nightly-bookworm-slim 50 | - context: debian-slim 51 | args: | 52 | DEBIAN_VERSION=bullseye 53 | tags: | 54 | nightly-slim 55 | nightly-bullseye-slim 56 | - context: debian-slim 57 | args: | 58 | DEBIAN_VERSION=buster 59 | tags: | 60 | nightly-buster-slim 61 | 62 | runs-on: ubuntu-latest 63 | steps: 64 | - uses: actions/checkout@v2 65 | 66 | - uses: docker/setup-qemu-action@v1 67 | 68 | - uses: docker/setup-buildx-action@v1 69 | 70 | - uses: docker/login-action@v1 71 | if: github.event_name != 'pull_request' 72 | with: 73 | registry: ghcr.io 74 | username: ${{ github.actor }} 75 | password: ${{ secrets.GITHUB_TOKEN }} 76 | 77 | - uses: docker/login-action@v1 78 | if: github.event_name != 'pull_request' 79 | with: 80 | username: rustopsbot 81 | password: ${{ secrets.DOCKER_HUB_TOKEN }} 82 | 83 | - id: meta 84 | uses: docker/metadata-action@v3 85 | with: 86 | images: | 87 | ghcr.io/rust-lang/rust 88 | rustlang/rust 89 | tags: ${{ matrix.tags }} 90 | 91 | - uses: docker/build-push-action@v2 92 | with: 93 | context: ${{ matrix.context }} 94 | build-args: ${{ matrix.args }} 95 | platforms: linux/amd64,linux/arm64 96 | push: ${{ github.event_name != 'pull_request' }} 97 | tags: ${{ steps.meta.outputs.tags }} 98 | labels: ${{ steps.meta.outputs.labels }} 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Find it on the [Docker Hub](https://hub.docker.com/r/rustlang/rust/) and the 2 | [GitHub Container Registry](https://github.com/rust-lang/docker-rust-nightly/pkgs/container/rust). 3 | 4 | For typical use cases, see the [official image](https://hub.docker.com/_/rust/). 5 | 6 | This image has two tags, `nightly` and `nightly-slim`, which are updated every 7 | day to match the current Rust nightly. The `nightly` tag is configured 8 | identically to that of the `latest` tag of the official image, except that the 9 | nightly toolchain is selected via rustup. The `nightly-slim` tag is configured 10 | identically to that of the `slim` tag of the official image, except that the 11 | nightly toolchain is selected via rustup. 12 | -------------------------------------------------------------------------------- /alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | # to specify a different alpine version, use --build-arg ALPINE_VERSION=3.12 2 | # when building the image 3 | ARG ALPINE_VERSION=3.14 4 | FROM alpine:${ALPINE_VERSION} 5 | 6 | RUN apk add --no-cache \ 7 | ca-certificates \ 8 | gcc 9 | 10 | ENV RUSTUP_HOME=/usr/local/rustup \ 11 | CARGO_HOME=/usr/local/cargo \ 12 | PATH=/usr/local/cargo/bin:$PATH 13 | 14 | RUN set -eux; \ 15 | apkArch="$(apk --print-arch)"; \ 16 | case "$apkArch" in \ 17 | x86_64) rustArch='x86_64-unknown-linux-musl' ;; \ 18 | aarch64) rustArch='aarch64-unknown-linux-musl' ;; \ 19 | *) echo >&2 "unsupported architecture: $apkArch"; exit 1 ;; \ 20 | esac; \ 21 | \ 22 | url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \ 23 | wget "$url"; \ 24 | chmod +x rustup-init; \ 25 | ./rustup-init -y --no-modify-path --default-toolchain nightly; \ 26 | rm rustup-init; \ 27 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 28 | rustup --version; \ 29 | cargo --version; \ 30 | rustc --version; 31 | -------------------------------------------------------------------------------- /debian-slim/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG DEBIAN_VERSION 2 | FROM debian:${DEBIAN_VERSION}-slim 3 | 4 | ENV RUSTUP_HOME=/usr/local/rustup \ 5 | CARGO_HOME=/usr/local/cargo \ 6 | PATH=/usr/local/cargo/bin:$PATH 7 | 8 | RUN set -eux; \ 9 | apt-get update; \ 10 | apt-get install -y --no-install-recommends \ 11 | ca-certificates \ 12 | gcc \ 13 | libc6-dev \ 14 | wget \ 15 | ; \ 16 | dpkgArch="$(dpkg --print-architecture)"; \ 17 | case "${dpkgArch##*-}" in \ 18 | amd64) rustArch='x86_64-unknown-linux-gnu' ;; \ 19 | arm64) rustArch='aarch64-unknown-linux-gnu' ;; \ 20 | *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ 21 | esac; \ 22 | \ 23 | url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \ 24 | wget "$url"; \ 25 | chmod +x rustup-init; \ 26 | ./rustup-init -y --no-modify-path --default-toolchain nightly; \ 27 | rm rustup-init; \ 28 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 29 | rustup --version; \ 30 | cargo --version; \ 31 | rustc --version; \ 32 | \ 33 | apt-get remove -y --auto-remove \ 34 | wget \ 35 | ; \ 36 | rm -rf /var/lib/apt/lists/*; 37 | -------------------------------------------------------------------------------- /debian/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG DEBIAN_VERSION 2 | FROM buildpack-deps:${DEBIAN_VERSION} 3 | 4 | ENV RUSTUP_HOME=/usr/local/rustup \ 5 | CARGO_HOME=/usr/local/cargo \ 6 | PATH=/usr/local/cargo/bin:$PATH 7 | 8 | RUN set -eux; \ 9 | dpkgArch="$(dpkg --print-architecture)"; \ 10 | case "${dpkgArch##*-}" in \ 11 | amd64) rustArch='x86_64-unknown-linux-gnu' ;; \ 12 | arm64) rustArch='aarch64-unknown-linux-gnu' ;; \ 13 | *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ 14 | esac; \ 15 | \ 16 | url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \ 17 | wget "$url"; \ 18 | chmod +x rustup-init; \ 19 | ./rustup-init -y --no-modify-path --default-toolchain nightly; \ 20 | rm rustup-init; \ 21 | chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ 22 | rustup --version; \ 23 | cargo --version; \ 24 | rustc --version; 25 | --------------------------------------------------------------------------------