From 6e566766a3abb078a21775ec49d07a3e82e81b17 Mon Sep 17 00:00:00 2001 From: Brianna Bennett Date: Thu, 13 Jun 2024 17:43:04 -0700 Subject: [PATCH] Add Alpine Linux --- .github/workflows/build.yaml | 37 ++++++++++++++++++++++++++++++++++++ alpine/Dockerfile | 5 +++++ alpine/helpers/build.sh | 36 +++++++++++++++++++++++++++++++++++ alpine/helpers/inittab | 13 +++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 alpine/Dockerfile create mode 100755 alpine/helpers/build.sh create mode 100644 alpine/helpers/inittab diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 19bd05f..cdcf2f8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -326,3 +326,40 @@ jobs: asset_path: ./rocky/lx-rocky-${{ matrix.RELEASE }}.tar.xz asset_name: lx-rocky-${{ matrix.RELEASE }}-${{ needs.prepare.outputs.tag }}.tar.xz asset_content_type: application/x-xz + + alpine: + needs: prepare + strategy: + matrix: + RELEASE: + - 3 + + name: Build Alpine Linux ${{ matrix.RELEASE }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Build Image + id: build_image + run: | + set -xe + cd alpine + tar=lx-alpine-${{ matrix.RELEASE }}.tar + tag=release:$$ + docker build --tag $tag --build-arg ALPINE_RELEASE=${{ matrix.RELEASE }} . + container=$(docker create $tag) + docker cp $container:. - > $tar + docker rm $container + docker rmi $tag + xz $tar + - name: Upload Release Asset + id: upload_release_asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.prepare.outputs.upload_url }} + asset_path: ./alpine/lx-alpine-${{ matrix.RELEASE }}.tar.xz + asset_name: lx-alpine-${{ matrix.RELEASE }}-${{ needs.prepare.outputs.tag }}.tar.xz + asset_content_type: application/x-xz diff --git a/alpine/Dockerfile b/alpine/Dockerfile new file mode 100644 index 0000000..e252d38 --- /dev/null +++ b/alpine/Dockerfile @@ -0,0 +1,5 @@ +ARG ALPINE_RELEASE +FROM alpine:${ALPINE_RELEASE} +COPY helpers /helpers +ARG ALPINE_RELEASE=${ALPINE_RELEASE} +RUN cd /helpers; sh build.sh; cd /; rm -rf helpers diff --git a/alpine/helpers/build.sh b/alpine/helpers/build.sh new file mode 100755 index 0000000..5604f53 --- /dev/null +++ b/alpine/helpers/build.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +# Update the package manager +apk update +# Update all packages +apk upgrade + +# Install extras +apk add -u \ + alpine-base \ + alpine-conf \ + alpine-release \ + apk-tools-doc \ + bash \ + bind-tools \ + busybox-mdev-openrc \ + busybox-openrc \ + busybox-suid \ + curl \ + logrotate \ + logrotate-openrc \ + man-db \ + man-pages \ + mdev-conf \ + openrc \ + openssh \ + sudo \ + vim + +# Enable services +rc-update add bootmisc boot +rc-update add devfs boot +rc-update add syslog boot +rc-update add crond default +rc-update add local default +rc-update add sshd default diff --git a/alpine/helpers/inittab b/alpine/helpers/inittab new file mode 100644 index 0000000..35ecb4c --- /dev/null +++ b/alpine/helpers/inittab @@ -0,0 +1,13 @@ +# /etc/inittab +::sysinit:/sbin/openrc sysinit +::sysinit:/sbin/openrc boot +::wait:/sbin/openrc default + +# Set up a couple of getty's +::respawn:/sbin/getty 38400 console + +# Stuff to do for the 3-finger salute +::ctrlaltdel:/sbin/reboot + +# Stuff to do before rebooting +::shutdown:/sbin/openrc shutdown