From d763cc1179d56b835409bf3b049ccdbcdaa2624a Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 25 Feb 2023 02:12:08 +0100 Subject: [PATCH 1/6] Remove old reference --- docker/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 173f727..73f9594 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,3 @@ -# NAME: dclong/rustpython FROM alpine:3.17 as builder WORKDIR /workdir From 15f5e7b5bdc3005a55c7b52113bea4367625c2ff Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 25 Feb 2023 02:13:50 +0100 Subject: [PATCH 2/6] Remove not needed permission --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index da6abee..0614f16 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,6 @@ name: Publish Docker image permissions: contents: read - packages: write on: release: From 1d65dc9cf5f272d5d64888879ffce3ede5655e65 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sun, 15 Oct 2023 13:57:09 +0200 Subject: [PATCH 3/6] Bump to 0.3.0 --- .github/workflows/build.yml | 2 +- .github/workflows/publish.yml | 4 ++-- README.md | 2 +- docker/Dockerfile | 24 +++++++----------------- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5538f62..9880fec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: platform: ["linux/arm/v6", "linux/arm/v7", "linux/arm64/v8", "linux/386", "linux/ppc64le", "linux/amd64"] steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # https://github.com/docker/setup-qemu-action - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0614f16..1359cb9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,8 +22,8 @@ jobs: - { platform: "linux/ppc64le", internal-tag: "ppc64le" } - { platform: "linux/amd64", internal-tag: "amd64" } steps: - - name: Check out the repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v4 # https://github.com/docker/setup-qemu-action - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/README.md b/README.md index 17c1084..4d12ae0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # A docker rustpython image -This is a Docker image for the RustPython project. +This is a Docker image for the [RustPython](https://github.com/RustPython/RustPython#readme) project. It had the default feature flags + `freeze-stdlib`. You can find it on [Docker Hub](https://hub.docker.com/r/botsudo/docker-rustpython) and the sources on [GitHub](https://github.com/sudo-bot/docker-rustpython). diff --git a/docker/Dockerfile b/docker/Dockerfile index 73f9594..f423f52 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,8 +1,8 @@ -FROM alpine:3.17 as builder +FROM alpine:3.18 as builder WORKDIR /workdir -ARG RUST_PYTHON_VERSION="0.2.0" +ARG RUST_PYTHON_VERSION="0.3.0" ARG BUILD_DATE ARG VCS_REF @@ -12,36 +12,26 @@ ENV CARGO_INSTALL_ROOT="/workdir" # See: https://github.com/rust-lang/cargo/issues/6513#issuecomment-1440029221 ENV CARGO_NET_GIT_FETCH_WITH_CLI=true -# Newer rust needed due to let...else feature -RUN apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community rust cargo - -RUN apk --no-cache add musl-dev git - -ADD https://github.com/RustPython/RustPython/archive/refs/tags/v$RUST_PYTHON_VERSION.tar.gz /tmp/v$RUST_PYTHON_VERSION.tar.gz -ADD https://github.com/RustPython/__doc__/archive/d927debd491e4c45b88e953e6e50e4718e0f2965.tar.gz /tmp/rp__doc__.tar.gz - -# See: https://github.com/RustPython/RustPython/pull/4499 -ADD https://github.com/RustPython/RustPython/commit/9cac89347e2276fcb309f108561e99f4be5baff2.patch /tmp/9cac89347e2276fcb309f108561e99f4be5baff2.patch - -RUN mkdir /workdir/rp__doc__/ && tar --strip-components=1 -C /workdir/rp__doc__/ -xzf /tmp/rp__doc__.tar.gz +ADD https://github.com/RustPython/RustPython/archive/refs/tags/$RUST_PYTHON_VERSION.tar.gz /tmp/v$RUST_PYTHON_VERSION.tar.gz RUN tar --strip-components=1 -C /workdir -xzf /tmp/v$RUST_PYTHON_VERSION.tar.gz -RUN git apply /tmp/9cac89347e2276fcb309f108561e99f4be5baff2.patch # Remove the git mode that triggers an error on armv6 and armv7 # Ref: https://github.com/rust-lang/cargo/issues/2808 (failed to mmap. Could not write data: Out of memory; class=Os (2)) RUN sed -i 's#{ git = .*#{ path = "/workdir/rp__doc__/" }#' /workdir/derive-impl/Cargo.toml +RUN apk add --no-cache rust cargo musl-dev git + RUN cargo fetch RUN cargo build --features freeze-stdlib --release --locked --offline --bin rustpython -FROM alpine:3.17 +FROM alpine:3.18 RUN apk --no-cache add musl libgcc COPY --from=builder /workdir/target/release/rustpython /usr/local/bin/rustpython -COPY <<-EOT /usr/local/share/sbom/rustpython.spdx.json +COPY <<-"EOT" /usr/local/share/sbom/rustpython.spdx.json { "spdxVersion": "SPDX-2.3", "dataLicense": "CC0-1.0", From feba04dcc134cb5f108d25b431a951aa767b839b Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 6 Jul 2024 00:39:02 +0200 Subject: [PATCH 4/6] Bump workflows --- .github/workflows/build.yml | 4 ++-- .github/workflows/publish.yml | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9880fec..e4bed5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,10 +23,10 @@ jobs: uses: actions/checkout@v4 # https://github.com/docker/setup-qemu-action - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 # https://github.com/docker/setup-buildx-action - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build docker image run: make docker-build env: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1359cb9..aa7933a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,12 +26,12 @@ jobs: uses: actions/checkout@v4 # https://github.com/docker/setup-qemu-action - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 # https://github.com/docker/setup-buildx-action - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: docker.io username: ${{ secrets.DOCKER_REPOSITORY_LOGIN }} @@ -56,7 +56,7 @@ jobs: name: Create the image manifest steps: - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: docker.io username: ${{ secrets.DOCKER_REPOSITORY_LOGIN }} @@ -69,7 +69,8 @@ jobs: docker.io/botsudo/docker-rustpython:arm64v8-latest \ docker.io/botsudo/docker-rustpython:386-latest \ docker.io/botsudo/docker-rustpython:ppc64le-latest \ - docker.io/botsudo/docker-rustpython:amd64-latest + docker.io/botsudo/docker-rustpython:amd64-latest \ + --amend - name: Push the manifest run: docker manifest push docker.io/botsudo/docker-rustpython:latest - name: Inspect the manifest From 2129657f30d92ef88cc34ce383a7ee422dab152f Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 6 Jul 2024 00:40:23 +0200 Subject: [PATCH 5/6] Update to Alpine 3.20 and RustPython 0.3.1 Closes #1 --- docker/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f423f52..94527db 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,8 +1,8 @@ -FROM alpine:3.18 as builder +FROM alpine:3.20 as builder WORKDIR /workdir -ARG RUST_PYTHON_VERSION="0.3.0" +ARG RUST_PYTHON_VERSION="0.3.1" ARG BUILD_DATE ARG VCS_REF @@ -26,7 +26,7 @@ RUN cargo fetch RUN cargo build --features freeze-stdlib --release --locked --offline --bin rustpython -FROM alpine:3.18 +FROM alpine:3.20 RUN apk --no-cache add musl libgcc From fa5a21600bab5705c701965821e1e83d589fd4e5 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Mon, 5 Aug 2024 10:38:17 +0200 Subject: [PATCH 6/6] Bump hub-tool --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aa7933a..6e8270f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -82,7 +82,7 @@ jobs: steps: - name: Install Docker hub-tool run: | - curl -sL https://github.com/docker/hub-tool/releases/download/v0.4.5/hub-tool-linux-amd64.tar.gz -o hub-tool-linux.tar.gz + curl -sL https://github.com/docker/hub-tool/releases/download/v0.4.6/hub-tool-linux-amd64.tar.gz -o hub-tool-linux.tar.gz tar --strip-components=1 -xzf ./hub-tool-linux.tar.gz ./hub-tool --version - name: Login hub-tool @@ -101,7 +101,7 @@ jobs: env: DOCKER_USERNAME: ${{ secrets.DOCKER_REPOSITORY_LOGIN }} DOCKER_PASSWORD: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }} - - name: Remove PR container image via hub-tool + - name: Remove the temporary images via hub-tool run: | ./hub-tool tag rm --verbose --force docker.io/botsudo/docker-rustpython:armv6-latest || true ./hub-tool tag rm --verbose --force docker.io/botsudo/docker-rustpython:armv7-latest || true