ci: build for x86_64 and arm64
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
This is an *attempt* to make the build system work for arm64 images as well, fingers crossed!
This commit is contained in:
parent
8f611c5d37
commit
b16d9c3b71
2 changed files with 10 additions and 3 deletions
|
@ -3,15 +3,22 @@ when:
|
||||||
branch: main
|
branch: main
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build-x86_64
|
||||||
image: rust:bookworm
|
image: rust:bookworm
|
||||||
commands:
|
commands:
|
||||||
cargo build --release
|
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
|
- name: container-build-and-publish
|
||||||
image: docker
|
image: docker
|
||||||
commands:
|
commands:
|
||||||
- docker login --username radical --password $PASSWORD git.gorb.app
|
- 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:
|
environment:
|
||||||
PASSWORD:
|
PASSWORD:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
|
|
|
@ -2,7 +2,7 @@ FROM debian:12-slim
|
||||||
|
|
||||||
RUN apt update && apt install libssl3 && rm -rf /var/lib/apt/lists/* /var/cache/apt/* /tmp/*
|
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
|
COPY entrypoint.sh /usr/bin/entrypoint.sh
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue