Skip to content

fix

fix #34

Workflow file for this run

name: Build ParchLinux Docker Images
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
workflow_dispatch:
jobs:
build-rootfs:
runs-on: ubuntu-latest
container:
image: archlinux:latest
strategy:
matrix:
image: [base, base-devel, multilib-devel]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: repo
- name: Install Arch prerequisites
run: |
pacman -Syu --noconfirm
pacman -S --noconfirm base-devel git make devtools fakeroot fakechroot sudo shadow zstd xz gzip coreutils bash sed awk grep
# Create non-root builder
useradd -m -s /bin/bash builder
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
- name: Fix permissions
run: chown -R builder:builder repo
- name: Build rootfs as non-root
run: |
sudo -u builder bash -c "cd repo && make image-${{ matrix.image }}"
ls -alh repo/output
sha256sum repo/output/${{ matrix.image }}.tar.zst > repo/output/${{ matrix.image }}.tar.zst.SHA256
- name: Upload rootfs artifact
uses: actions/upload-artifact@v4
with:
name: parchlinux-rootfs-${{ matrix.image }}
path: |
repo/output/${{ matrix.image }}.tar.zst
repo/output/${{ matrix.image }}.tar.zst.SHA256
Dockerfile.template
build-docker:
runs-on: ubuntu-latest
needs: build-rootfs
strategy:
matrix:
image: [base, base-devel, multilib-devel]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: repo
- name: Download rootfs artifact
uses: actions/download-artifact@v4
with:
name: parchlinux-rootfs-${{ matrix.image }}
path: repo/output
- name: Verify files
run: |
ls -alh repo/output/repo/output
cat repo/output/repo/output/${{ matrix.image }}.tar.zst.SHA256
sha256sum -c repo/output/${{ matrix.image }}.tar.zst.SHA256
- name: Prepare Dockerfile
run: |
bash repo/scripts/make-dockerfile.sh \
"${{ matrix.image }}.tar.zst" \
"${{ matrix.image }}" \
repo/output "true" "Dev"
- name: Build Docker image
run: |
docker build -f repo/output/Dockerfile.${{ matrix.image }} \
-t parchlinux:${{ matrix.image }} \
repo
- name: Save Docker image as artifact
run: docker save parchlinux:${{ matrix.image }} | zstd -o repo/parchlinux-${{ matrix.image }}.tar.zst
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: parchlinux-docker-${{ matrix.image }}
path: repo/parchlinux-${{ matrix.image }}.tar.zst