Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/mirror_stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 48 additions & 0 deletions nightly/noble/Dockerfile
Original file line number Diff line number Diff line change
@@ -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;
44 changes: 44 additions & 0 deletions nightly/resolute/Dockerfile
Original file line number Diff line number Diff line change
@@ -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;
47 changes: 47 additions & 0 deletions stable/noble/Dockerfile
Original file line number Diff line number Diff line change
@@ -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;
43 changes: 43 additions & 0 deletions stable/resolute/Dockerfile
Original file line number Diff line number Diff line change
@@ -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;
95 changes: 92 additions & 3 deletions x.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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]
Expand All @@ -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():
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -409,6 +497,7 @@ def generate_stackbrew_library():

update_debian()
update_alpine()
update_ubuntu()
update_ci()
update_mirror_stable_ci()
update_nightly_ci()
Expand Down
Loading