From e165be25a3b42dff1394d649e6d7cff72119bbd0 Mon Sep 17 00:00:00 2001 From: honjow Date: Sat, 30 Mar 2024 23:22:01 +0800 Subject: [PATCH] docker --- .github/workflows/beta-sk.yml | 16 +++++++++++----- Dockerfile | 19 +++++++++++++++++++ build.sh | 4 ++-- 3 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 Dockerfile diff --git a/.github/workflows/beta-sk.yml b/.github/workflows/beta-sk.yml index 377ef05..baa84ef 100644 --- a/.github/workflows/beta-sk.yml +++ b/.github/workflows/beta-sk.yml @@ -13,9 +13,15 @@ jobs: remove-dotnet: 'true' remove-android: 'true' - uses: actions/checkout@v4 + # - name: Build Image + # uses: docker://archlinux:latest + # with: + # options: --privileged=true + # args: | + # ./build.sh beta-sk - name: Build Image - uses: docker://archlinux:latest - with: - options: --privileged=true - args: | - ./build.sh beta-sk + run: | + mkdir -p output + mkdir -p workdir + docker pull archlinux:latest + docker run -u root --privileged=true -v $(pwd):/holoiso -v $(pwd)/workdir:/holoiso/workdir -v $(pwd)/output:/holoiso/output -e GITHUB_REF_NAME=$GITHUB_REF_NAME -w /holoiso archlinux:latest ./build.sh beta-sk diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3b7264c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM archlinux:base-devel + +RUN echo -e "keyserver-options auto-key-retrieve" >> /etc/pacman.d/gnupg/gpg.conf && \ + # Cannot check space in chroot + sed -i '/CheckSpace/s/^/#/g' /etc/pacman.conf && \ + pacman-key --init && \ + pacman --noconfirm -Syyuu && \ + pacman --noconfirm -S \ + arch-install-scripts \ + btrfs-progs \ + base-devel \ + fmt \ + xcb-util-wm \ + wget \ + sudo \ + && \ + pacman --noconfirm -S --needed git && \ + echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + useradd build -G wheel -m \ No newline at end of file diff --git a/build.sh b/build.sh index a85a002..7063454 100755 --- a/build.sh +++ b/build.sh @@ -13,5 +13,5 @@ pacman-key --init pacman --noconfirm -Syu btrfs-progs archiso git reflector git clone https://github.com/3003n/buildroot buildroot -b sk git clone https://github.com/3003n/postcopy -b ${POSTCOPY_CLONE} buildroot/postcopy_$1 -mkdir -p $(pwd)/output $(pwd)/workdir -bash buildroot/build.sh --flavor $1 --deployment_rel $1 --snapshot_ver "${GITHUB_REF_NAME}" --workdir $(pwd)/workdir --output-dir $(pwd)/output/holoiso-images --add-release \ No newline at end of file +# mkdir -p $(pwd)/output $(pwd)/workdir +bash buildroot/build.sh --flavor $1 --deployment_rel $1 --snapshot_ver "${GITHUB_REF_NAME}" --workdir /workdir --output-dir /output/holoiso-images --add-release \ No newline at end of file