From 6d459bd781d6e81e1992e420cfbb70ea4fbad611 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Sun, 14 Jun 2026 16:06:24 +0200 Subject: [PATCH 1/9] Create docker-publish.yml --- .github/workflows/docker-publish.yml | 96 ++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..98bd621 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,96 @@ +name: Docker + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + push: + branches: [ "main" ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ "main" ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0 + with: + cosign-release: 'v2.2.4' + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} From 8f5682ba6ab0b96438bed5804cb8cc6432ced151 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Sun, 14 Jun 2026 16:08:26 +0200 Subject: [PATCH 2/9] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 98bd621..ffa43d6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -43,6 +43,9 @@ jobs: with: cosign-release: 'v2.2.4' + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + # Set up BuildKit Docker container builder to be able to build # multi-platform images and export cache # https://github.com/docker/setup-buildx-action @@ -74,6 +77,7 @@ jobs: uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 with: context: . + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 40140deae90624403940ebb5f63d17d9a706c27e Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Sun, 14 Jun 2026 16:10:35 +0200 Subject: [PATCH 3/9] Create Dockerfile --- Dockerfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ee792f1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM debian:bookworm AS build + +RUN apt update +RUN apt upgrade -y + +RUN apt install cargo -y + +RUN mkdir /src +WORKDIR /src +COPY . . + +RUN cargo build --release + +FROM debian:bookworm AS base +COPY --from=build /src/target/release/cherry-server /bin +RUN chmod +x /bin/cherry-server +ENTRYPOINT /bin/cherry-server From 9c51377e204c9d1791030a07c1d2b34b61b0a4f1 Mon Sep 17 00:00:00 2001 From: Tristan Brice Velloza Kildaire Date: Sun, 14 Jun 2026 16:37:55 +0200 Subject: [PATCH 4/9] Use neweer debian --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee792f1..c01f291 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bookworm AS build +FROM debian:latest AS build RUN apt update RUN apt upgrade -y @@ -11,7 +11,7 @@ COPY . . RUN cargo build --release -FROM debian:bookworm AS base +FROM debian:latest AS base COPY --from=build /src/target/release/cherry-server /bin RUN chmod +x /bin/cherry-server ENTRYPOINT /bin/cherry-server From cea827453fc8877523b6df2ce9425ba5da344e3e Mon Sep 17 00:00:00 2001 From: Tristan Brice Velloza Kildaire Date: Sun, 14 Jun 2026 16:41:56 +0200 Subject: [PATCH 5/9] Added missing `pkg-config` --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index c01f291..571bac5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ RUN apt update RUN apt upgrade -y RUN apt install cargo -y +RUN apt install pkg-config -y RUN mkdir /src WORKDIR /src From beb3cac9b2ad4f44e572fd97a99f0294b6d44637 Mon Sep 17 00:00:00 2001 From: Tristan Brice Velloza Kildaire Date: Sun, 14 Jun 2026 16:46:59 +0200 Subject: [PATCH 6/9] Add --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 571bac5..63ea846 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ RUN apt upgrade -y RUN apt install cargo -y RUN apt install pkg-config -y +RUN apt install openssl-dev -y RUN mkdir /src WORKDIR /src From f587390585f01a078670cba08b322477f09e6a26 Mon Sep 17 00:00:00 2001 From: Tristan Brice Velloza Kildaire Date: Sun, 14 Jun 2026 16:49:01 +0200 Subject: [PATCH 7/9] Fix --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 63ea846..5ea205d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ RUN apt upgrade -y RUN apt install cargo -y RUN apt install pkg-config -y -RUN apt install openssl-dev -y +RUN apt install openssl -y RUN mkdir /src WORKDIR /src From 46ff0777430ceea9657ace73f29864366a2e7656 Mon Sep 17 00:00:00 2001 From: Tristan Brice Velloza Kildaire Date: Sun, 14 Jun 2026 16:50:41 +0200 Subject: [PATCH 8/9] Fixed package --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5ea205d..7927cb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ RUN apt upgrade -y RUN apt install cargo -y RUN apt install pkg-config -y -RUN apt install openssl -y +RUN apt install libssl-dev -y RUN mkdir /src WORKDIR /src From efa9fe558d87e233f0b6e68ced6f8c07a390c2af Mon Sep 17 00:00:00 2001 From: Tristan Brice Velloza Kildaire Date: Mon, 15 Jun 2026 22:10:09 +0200 Subject: [PATCH 9/9] Added --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 7927cb9..74cc15e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,3 +17,4 @@ FROM debian:latest AS base COPY --from=build /src/target/release/cherry-server /bin RUN chmod +x /bin/cherry-server ENTRYPOINT /bin/cherry-server +CMD --config "/config.toml"