From 13d49adfdd4c143faeb8c74faccbe048348c1e15 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Thu, 17 Apr 2025 13:58:04 +0200 Subject: [PATCH] docker --- .woodpecker/build.yml | 24 ++++++++++++++++++++++-- Dockerfile | 4 +++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml index 095bf10..449a116 100644 --- a/.woodpecker/build.yml +++ b/.woodpecker/build.yml @@ -1,14 +1,34 @@ +matrix: + platform: + - linux/amd64 + - linux/arm64 + +labels: + platform: ${platform} + when: - event: push branch: main steps: - - name: pacstrap + - name: pacstrap_x86_64 image: git.hydrar.de/navos/navos:latest privileged: true commands: - pacman -Syu --noconfirm && pacman -S --noconfirm navinstall && yes | pacman -Scc - - mkdir os && navinstall create-tar os + - mkdir os-x86_64 && navinstall create-tar os-x86_64 + when: + platform: linux/amd64 + + - name: pacstrap_aarch64 + image: git.hydrar.de/navos/navos:latest + privileged: true + commands: + - pacman -Syu --noconfirm && pacman -S --noconfirm navinstall && yes | pacman -Scc + - mkdir os-aarch64 && navinstall create-tar os-aarch64 + when: + platform: linux/arm64 + - name: build image: woodpeckerci/plugin-docker-buildx settings: diff --git a/Dockerfile b/Dockerfile index f37998e..389d459 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ FROM scratch -COPY --from=builder ./os/ / +ARG TARGETARCH +ARG ARCH=$(if [ "$TARGETARCH" -eq "linux/arm64" ]; then echo "aarch64"; else echo "x86_64"; fi) +COPY ./os-${ARCH}/ / CMD ["/bin/sh"] \ No newline at end of file