Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 0 additions & 112 deletions .github/workflows/base.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/build-box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BASE_VERSION=${{ steps.meta.outputs.version }}

- name: Export as root fs
uses: docker/build-push-action@v3
Expand All @@ -54,6 +56,8 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=tar,dest=alpine-boxes-${{ inputs.context }}.rootfs.tar
build-args: |
BASE_VERSION=${{ steps.meta.outputs.version }}

- name: Get distributions
uses: actions/download-artifact@v3
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# cSpell: disable
name: Build base image and RootFS
on:
workflow_dispatch:
push:
branches:
- "main"
tags:
- "v*"
pull_request:
branches:
- "main"

jobs:
prepare-artifacts:
runs-on: ubuntu-latest
steps:
- run: touch SHA256SUMS
- name: shasums artifact
uses: actions/upload-artifact@v3
with:
name: shasums
path: |
SHA256SUMS

build-base:
needs: [prepare-artifacts]
uses: ./.github/workflows/build-box.yml
with:
context: base
secrets: inherit

build-minimal:
needs: [prepare-artifacts]
uses: ./.github/workflows/build-box.yml
with:
context: minimal
secrets: inherit

build-docker:
needs: [build-base]
uses: ./.github/workflows/build-box.yml
with:
context: docker
secrets: inherit

build-podman:
needs: [build-base]
uses: ./.github/workflows/build-box.yml
with:
context: podman
secrets: inherit

build-k3s:
needs: [build-base]
uses: ./.github/workflows/build-box.yml
with:
context: k3s
secrets: inherit

build-basevm:
needs: [build-minimal]
uses: ./.github/workflows/build-box.yml
with:
context: basevm
secrets: inherit

release-rootfses:
needs:
- build-base
- build-minimal
- build-docker
- build-podman
- build-k3s
- build-basevm
runs-on: ubuntu-latest
if: contains(github.ref, 'refs/tags/v') && !github.event.release.prerelease
steps:
- name: Get Root File Systems
uses: actions/download-artifact@v3

- name: release
uses: softprops/action-gh-release@v1
with:
files: |
rootfs/alpine-boxes-*.rootfs.tar.gz
shasums/SHA256SUMS
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alpinevm.*
7 changes: 5 additions & 2 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# syntax=docker/dockerfile:1.3-labs
FROM alpine:3.17
ARG ALPINE_VERSION=3.17
ARG ALPINE_IMAGE=alpine
FROM ${ALPINE_IMAGE}:${ALPINE_VERSION}


# Add the dependencies
Expand All @@ -23,7 +25,8 @@ RUN git clone --quiet --depth 1 https://github.com/ohmyzsh/ohmyzsh.git /usr/shar
# OpenRC stuff
RUN mkdir -p /lib/rc/init.d && \
ln -s /lib/rc/init.d /run/openrc && \
touch /lib/rc/init.d/softlevel
touch /lib/rc/init.d/softlevel && \
cp /etc/rc.conf /etc/rc.conf.orig

ADD rc.conf /etc/rc.conf

Expand Down
82 changes: 82 additions & 0 deletions basevm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# syntax=docker/dockerfile:1.3-labs
ARG BASE_VERSION=latest
ARG BASE_IMAGE=ghcr.io/kaweezle/alpine-boxes-minimal
FROM ${BASE_IMAGE}:${BASE_VERSION}

ARG USERNAME=alpine
USER root

RUN apk add --no-progress --no-cache \
alpine-base \
less \
logrotate \
openssh \
openntpd \
acpi \
e2fsprogs-extra \
linux-virt \
cloud-init \
py3-pyserial \
py3-netifaces \
syslinux

RUN for s in cgroups devfs dmesg hwdrivers mdev; do ln -s /etc/init.d/$s /etc/runlevels/sysinit/$s; done \
&& \
for s in bootmisc hostname hwclock loadkmap modules networking swap sysctl syslog termencoding; do ln -s /etc/init.d/$s /etc/runlevels/boot/$s; done \
&& \
for s in killprocs mount-ro savecache; do ln -s /etc/init.d/$s /etc/runlevels/shutdown/$s; done \
&& \
for s in acpid crond openntpd sshd cloud-init cloud-config cloud-final; do ln -s /etc/init.d/$s /etc/runlevels/default/$s; done \
&& \
setup-hostname alpinevm \
&& \
setup-timezone -z Europe/Paris \
&& \
setup-keymap fr fr-azerty \
&& \
printf '\
auto lo\n\
iface lo inet loopback\n\
\n\
auto eth0\n\
iface eth0 inet dhcp\n\
hostname alpinevm\n\
' > /etc/network/interfaces \
&& \
sed -e '/disable_root:/ s/true/false/' \
-e '/ssh_pwauth:/ s/0/no/' \
-e '/name: alpine/a \ passwd: "*"' \
-e '/lock_passwd:/ s/True/False/' \
-e '/shell:/ s#/bin/ash#/bin/zsh#' \
-i /etc/cloud/cloud.cfg \
&& \
sed -e '/PermitRootLogin yes/d' \
-e 's/^#PasswordAuthentication yes/PasswordAuthentication no/' \
-e 's/^#PubkeyAuthentication yes/PubkeyAuthentication yes/' \
-i /etc/ssh/sshd_config \
&& \
echo "PubkeyAcceptedKeyTypes=+ssh-rsa" >> /etc/ssh/sshd_config \
&& \
sed -Ei \
-e 's/^[# ](rc_depend_strict)=.*/\1=NO/' \
-e 's/^[# ](rc_logger)=.*/\1=YES/' \
-e 's/^[# ](unicode)=.*/\1=YES/' \
-e 's/^[# ](rc_sys)=.*/\1=""/' \
/etc/rc.conf \
&& \
sed -Ei \
-e 's/^[# ]*(features)=.*/\1="base ext4 scsi virtio"/' \
/etc/mkinitfs/mkinitfs.conf \
&& \
sed -Ei \
-e "s|^[# ]*(default_kernel_opts)=.*|\1=\"\"|" \
-e "s|^[# ]*(modules)=.*|\1=\"ext4\"|" \
"$mnt"/etc/update-extlinux.conf \
&& \
echo "iso9660" >> /etc/filesystems \
&& \
usermod -p '*' root \
&& \
usermod -p '*' $USERNAME

USER $USERNAME
Loading