Skip to content

Commit

Permalink
Add Alpine Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
bahamat committed Jun 14, 2024
1 parent a456b94 commit 6e56676
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions alpine/helpers/build.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions alpine/helpers/inittab
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6e56676

Please sign in to comment.