diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3988436..500af26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,10 @@ jobs: variant: alpine3.23 - name: alpine3.24 variant: alpine3.24 + - name: noble + variant: noble + - name: resolute + variant: resolute #VERSIONS name: ${{ matrix.name }} steps: diff --git a/.github/workflows/mirror_stable.yml b/.github/workflows/mirror_stable.yml index 307d566..6b3fa9b 100644 --- a/.github/workflows/mirror_stable.yml +++ b/.github/workflows/mirror_stable.yml @@ -47,6 +47,22 @@ jobs: 1.100-alpine 1.100.0-alpine alpine + - name: noble + tags: | + 1-noble + 1.100-noble + 1.100.0-noble + noble + - name: resolute + tags: | + 1-resolute + 1.100-resolute + 1.100.0-resolute + resolute + 1 + 1.100 + 1.100.0 + latest - name: bookworm tags: | 1-bookworm diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index dcfd082..59ce99d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -44,6 +44,17 @@ jobs: tags: | nightly-trixie-slim nightly-slim + - name: noble + context: nightly/noble + platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/riscv64 + tags: | + nightly-noble + - name: resolute + context: nightly/resolute + platforms: linux/amd64,linux/arm64,linux/ppc64le + tags: | + nightly-resolute + nightly - name: alpine3.21 context: nightly/alpine3.21 platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/riscv64 diff --git a/nightly/noble/Dockerfile b/nightly/noble/Dockerfile new file mode 100644 index 0000000..e8ef26a --- /dev/null +++ b/nightly/noble/Dockerfile @@ -0,0 +1,48 @@ +FROM buildpack-deps:noble + +LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust + +ARG RUST_VERSION=nightly +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH \ + RUST_VERSION=${RUST_VERSION} + +RUN set -eux; \ + \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + rustArch='x86_64-unknown-linux-gnu'; \ + rustupSha256='b1c8cb14e30889e7e2999e6b69e62d9e9b9ffc0f4df8180564d306d9680e6c55'; \ + ;; \ + 'arm64') \ + rustArch='aarch64-unknown-linux-gnu'; \ + rustupSha256='9f608c142e0e38a78957d0661ba1dfaf0b6fb37184cfaa4b9a0aa57af6184282'; \ + ;; \ + 'ppc64el') \ + rustArch='powerpc64le-unknown-linux-gnu'; \ + rustupSha256='d5b321db031525fbee38b736846f07a16df22b354a1964bbb79ff83495dbc0c9'; \ + ;; \ + 'riscv64') \ + rustArch='riscv64gc-unknown-linux-gnu'; \ + rustupSha256='e4a960952692ac3dfb5fa4f74e593517241b83e43a93fbdcf2213c811748f1ae'; \ + ;; \ + *) \ + echo >&2 "unsupported architecture: $arch"; \ + exit 1; \ + ;; \ + esac; \ + \ + url="https://static.rust-lang.org/rustup/archive/1.29.3/${rustArch}/rustup-init"; \ + wget --progress=dot:giga "$url"; \ + echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ + \ + chmod +x rustup-init; \ + ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ + rm rustup-init; \ + chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ + \ + rustup --version; \ + cargo --version; \ + rustc --version; diff --git a/nightly/resolute/Dockerfile b/nightly/resolute/Dockerfile new file mode 100644 index 0000000..21f86dc --- /dev/null +++ b/nightly/resolute/Dockerfile @@ -0,0 +1,44 @@ +FROM buildpack-deps:resolute + +LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust + +ARG RUST_VERSION=nightly +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH \ + RUST_VERSION=${RUST_VERSION} + +RUN set -eux; \ + \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + rustArch='x86_64-unknown-linux-gnu'; \ + rustupSha256='b1c8cb14e30889e7e2999e6b69e62d9e9b9ffc0f4df8180564d306d9680e6c55'; \ + ;; \ + 'arm64') \ + rustArch='aarch64-unknown-linux-gnu'; \ + rustupSha256='9f608c142e0e38a78957d0661ba1dfaf0b6fb37184cfaa4b9a0aa57af6184282'; \ + ;; \ + 'ppc64el') \ + rustArch='powerpc64le-unknown-linux-gnu'; \ + rustupSha256='d5b321db031525fbee38b736846f07a16df22b354a1964bbb79ff83495dbc0c9'; \ + ;; \ + *) \ + echo >&2 "unsupported architecture: $arch"; \ + exit 1; \ + ;; \ + esac; \ + \ + url="https://static.rust-lang.org/rustup/archive/1.29.3/${rustArch}/rustup-init"; \ + wget --progress=dot:giga "$url"; \ + echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ + \ + chmod +x rustup-init; \ + ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ + rm rustup-init; \ + chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ + \ + rustup --version; \ + cargo --version; \ + rustc --version; diff --git a/stable/noble/Dockerfile b/stable/noble/Dockerfile new file mode 100644 index 0000000..570d4e8 --- /dev/null +++ b/stable/noble/Dockerfile @@ -0,0 +1,47 @@ +FROM buildpack-deps:noble + +LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH \ + RUST_VERSION=1.100.0 + +RUN set -eux; \ + \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + rustArch='x86_64-unknown-linux-gnu'; \ + rustupSha256='b1c8cb14e30889e7e2999e6b69e62d9e9b9ffc0f4df8180564d306d9680e6c55'; \ + ;; \ + 'arm64') \ + rustArch='aarch64-unknown-linux-gnu'; \ + rustupSha256='9f608c142e0e38a78957d0661ba1dfaf0b6fb37184cfaa4b9a0aa57af6184282'; \ + ;; \ + 'ppc64el') \ + rustArch='powerpc64le-unknown-linux-gnu'; \ + rustupSha256='d5b321db031525fbee38b736846f07a16df22b354a1964bbb79ff83495dbc0c9'; \ + ;; \ + 'riscv64') \ + rustArch='riscv64gc-unknown-linux-gnu'; \ + rustupSha256='e4a960952692ac3dfb5fa4f74e593517241b83e43a93fbdcf2213c811748f1ae'; \ + ;; \ + *) \ + echo >&2 "unsupported architecture: $arch"; \ + exit 1; \ + ;; \ + esac; \ + \ + url="https://static.rust-lang.org/rustup/archive/1.29.3/${rustArch}/rustup-init"; \ + wget --progress=dot:giga "$url"; \ + echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ + \ + chmod +x rustup-init; \ + ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ + rm rustup-init; \ + chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ + \ + rustup --version; \ + cargo --version; \ + rustc --version; diff --git a/stable/resolute/Dockerfile b/stable/resolute/Dockerfile new file mode 100644 index 0000000..8dd6a46 --- /dev/null +++ b/stable/resolute/Dockerfile @@ -0,0 +1,43 @@ +FROM buildpack-deps:resolute + +LABEL org.opencontainers.image.source=https://github.com/rust-lang/docker-rust + +ENV RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH \ + RUST_VERSION=1.100.0 + +RUN set -eux; \ + \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + rustArch='x86_64-unknown-linux-gnu'; \ + rustupSha256='b1c8cb14e30889e7e2999e6b69e62d9e9b9ffc0f4df8180564d306d9680e6c55'; \ + ;; \ + 'arm64') \ + rustArch='aarch64-unknown-linux-gnu'; \ + rustupSha256='9f608c142e0e38a78957d0661ba1dfaf0b6fb37184cfaa4b9a0aa57af6184282'; \ + ;; \ + 'ppc64el') \ + rustArch='powerpc64le-unknown-linux-gnu'; \ + rustupSha256='d5b321db031525fbee38b736846f07a16df22b354a1964bbb79ff83495dbc0c9'; \ + ;; \ + *) \ + echo >&2 "unsupported architecture: $arch"; \ + exit 1; \ + ;; \ + esac; \ + \ + url="https://static.rust-lang.org/rustup/archive/1.29.3/${rustArch}/rustup-init"; \ + wget --progress=dot:giga "$url"; \ + echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ + \ + chmod +x rustup-init; \ + ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ + rm rustup-init; \ + chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ + \ + rustup --version; \ + cargo --version; \ + rustc --version; diff --git a/x.py b/x.py index 2af3cc5..52973bc 100755 --- a/x.py +++ b/x.py @@ -72,6 +72,29 @@ def arches(self) -> list[DebianArch]: latest_alpine_version, ] +UbuntuArch = namedtuple("UbuntuArch", ["bashbrew", "dpkg", "qemu", "rust"]) + +ubuntu_arches = { + "amd64": UbuntuArch("amd64", "amd64", "linux/amd64", "x86_64-unknown-linux-gnu"), + "arm64v8": UbuntuArch("arm64v8", "arm64", "linux/arm64", "aarch64-unknown-linux-gnu"), + "ppc64le": UbuntuArch("ppc64le", "ppc64el", "linux/ppc64le", "powerpc64le-unknown-linux-gnu"), + "riscv64": UbuntuArch("riscv64", "riscv64", "linux/riscv64", "riscv64gc-unknown-linux-gnu"), +} + +class UbuntuRelease(NamedTuple): + name: str + arch_names: list[str] + is_latest: bool = False + + @property + def arches(self) -> list[DebianArch]: + return [ubuntu_arches[name] for name in self.arch_names] + +ubuntu_releases = [ + UbuntuRelease("noble", ["amd64", "arm64v8", "ppc64le", "riscv64"]), + UbuntuRelease("resolute", ["amd64", "arm64v8", "ppc64le"], is_latest=True), +] + def rustup_hash(arch): url = f"https://static.rust-lang.org/rustup/archive/{rustup_version}/{arch}/rustup-init.sha256" with request.urlopen(url) as f: @@ -128,6 +151,22 @@ def update_alpine(): f"{channel.name}/alpine{version}/Dockerfile", ) +def update_ubuntu(): + for release in ubuntu_releases: + arch_cases_str = arch_cases_start("$(dpkg --print-architecture)") + for ubuntu_arch in release.arches: + arch_cases_str += arch_case(ubuntu_arch.dpkg, ubuntu_arch.rust) + arch_cases_str += arch_cases_end() + + for channel in supported_channels: + render_template( + "Dockerfile-debian.template", + channel.rust_version, + release.name, + arch_cases_str, + f"{channel.name}/{release.name}/Dockerfile", + ) + def arch_cases_start(arch_cmd): start = f'arch="{arch_cmd}"; \\\n' start += ' case "$arch" in \\\n' @@ -195,6 +234,10 @@ def update_ci(): versions += f" - name: alpine{version}\n" versions += f" variant: alpine{version}\n" + for release in ubuntu_releases: + versions += f" - name: {release.name}\n" + versions += f" variant: {release.name}\n" + marker = "#VERSIONS\n" split = rendered.split(marker) rendered = split[0] + marker + versions + marker + split[2] @@ -220,6 +263,21 @@ def update_mirror_stable_ci(): for tag in tags: versions += f" {tag}\n" + for release in ubuntu_releases: + tags = [] + for version_tag in version_tags(): + tags.append(f"{version_tag}-{release.name}") + tags.append(release.name) + if release.is_latest: + for version_tag in version_tags(): + tags.append(version_tag) + tags.append("latest") + + versions += f" - name: {release.name}\n" + versions += " tags: |\n" + for tag in tags: + versions += f" {tag}\n" + for release in debian_releases: tags = [] for version_tag in version_tags(): @@ -243,11 +301,11 @@ def update_mirror_stable_ci(): for version_tag in version_tags(): tags.append(f"{version_tag}-slim") tags.append("slim") - + versions += f" - name: slim-{release.name}\n" versions += " tags: |\n" for tag in tags: - versions += f" {tag}\n" + versions += f" {tag}\n" marker = "#VERSIONS\n" split = config.split(marker) @@ -259,7 +317,6 @@ def update_nightly_ci(): file = ".github/workflows/nightly.yml" config = read_file(file) - versions = "" for release in debian_releases: platforms = ",".join(arch.qemu for arch in release.arches) @@ -282,6 +339,20 @@ def update_nightly_ci(): for tag in tags: versions += f" {tag}-slim\n" + for release in ubuntu_releases: + platforms = ",".join(arch.qemu for arch in release.arches) + + tags = [f"nightly-{release.name}"] + if release.is_latest: + tags.append("nightly") + + versions += f" - name: {release.name}\n" + versions += f" context: nightly/{release.name}\n" + versions += f" platforms: {platforms}\n" + versions += " tags: |\n" + for tag in tags: + versions += f" {tag}\n" + for version in alpine_versions: platforms = ",".join(arch.qemu for arch in alpine_arches) @@ -368,6 +439,23 @@ def generate_stackbrew_library(): bashbrews, os.path.join(stable.name, release.name, "slim")) + for release in ubuntu_releases: + tags = [] + for version_tag in version_tags(): + tags.append(f"{version_tag}-{release.name}") + tags.append(release.name) + if release.is_latest: + for version_tag in version_tags(): + tags.append(version_tag) + tags.append("latest") + + bashbrews = [a.bashbrew for a in release.arches] + + library += single_library( + tags, + bashbrews, + os.path.join(stable.name, release.name)) + for version in alpine_versions: tags = [] for version_tag in version_tags(): @@ -409,6 +497,7 @@ def generate_stackbrew_library(): update_debian() update_alpine() + update_ubuntu() update_ci() update_mirror_stable_ci() update_nightly_ci()