From 8f611c5d3753d8dc8f78a8fdfdc3af930735ae6e Mon Sep 17 00:00:00 2001 From: Radiicall Date: Fri, 2 May 2025 13:07:41 +0200 Subject: [PATCH 1/2] chore: use debian:12-slim in docker --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f224deb..03ce3e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:12 +FROM debian:12-slim RUN apt update && apt install libssl3 && rm -rf /var/lib/apt/lists/* /var/cache/apt/* /tmp/* From b16d9c3b714d7ba8577d91e13c381ad351b17a0d Mon Sep 17 00:00:00 2001 From: Radiicall Date: Fri, 2 May 2025 13:08:24 +0200 Subject: [PATCH 2/2] ci: build for x86_64 and arm64 This is an *attempt* to make the build system work for arm64 images as well, fingers crossed! --- .woodpecker/build-and-publish.yml | 11 +++++++++-- Dockerfile | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.woodpecker/build-and-publish.yml b/.woodpecker/build-and-publish.yml index 1ee9e1e..d9c218b 100644 --- a/.woodpecker/build-and-publish.yml +++ b/.woodpecker/build-and-publish.yml @@ -3,15 +3,22 @@ when: branch: main steps: - - name: build + - name: build-x86_64 image: rust:bookworm commands: cargo build --release + cp target/release/backend target/backend-amd64 + - name: build-arm64 + image: rust:bookworm + commands: + rustup target add aarch64-unknown-linux-gnu + cargo build --target=aarch64-unknown-linux-gnu --release + cp target/aarch64-unknown-linux-gnu/release/backend target/backend-arm64 - name: container-build-and-publish image: docker commands: - docker login --username radical --password $PASSWORD git.gorb.app - - docker build --rm --push -t git.gorb.app/gorb/backend:main . + - docker buildx build --platform linux/amd64,linux/arm64 --rm --push -t git.gorb.app/gorb/backend:main . environment: PASSWORD: from_secret: docker_password diff --git a/Dockerfile b/Dockerfile index 03ce3e4..f242d62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM debian:12-slim RUN apt update && apt install libssl3 && rm -rf /var/lib/apt/lists/* /var/cache/apt/* /tmp/* -COPY target/release/backend /usr/bin/gorb-backend +COPY target/release/backend-${TARGETARCH} /usr/bin/gorb-backend COPY entrypoint.sh /usr/bin/entrypoint.sh