Skip to content

Commit da88ece

Browse files
committed
better
1 parent f7b0ac8 commit da88ece

File tree

3 files changed

+47
-178
lines changed

3 files changed

+47
-178
lines changed

.github/workflows/build_gh_runner_images.yaml

Lines changed: 25 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -492,167 +492,33 @@ jobs:
492492
context: /tmp/DOCKERFILES/
493493
file: "/tmp/DOCKERFILES/ubuntu-builder.dockerfile"
494494
platforms: "linux/${{ matrix.platform }}"
495+
build-args: |
496+
ARCH=${{ matrix.arch }}
495497
tags: |
496498
pkgforge/ubuntu-builder:${{ matrix.arch }}
497499
pkgforge/ubuntu-builder:${{ matrix.arch }}-${{ env.DOCKER_TAG }}
498500
ghcr.io/pkgforge/devscripts/ubuntu-builder:${{ matrix.arch }}
499501
ghcr.io/pkgforge/devscripts/ubuntu-builder:${{ matrix.arch }}-${{ env.DOCKER_TAG }}
500-
push: true
501-
continue-on-error: true
502-
#------------------------------------------------------------------------------------#
503-
build-push-docker-ubuntu-base-aarch64:
504-
name: Push (Ubuntu-Base-aarch64) --> Docker Hub
505-
needs: [build-push-ubuntu-builder]
506-
#runs-on: arm64-linux-healthchecker
507-
#runs-on: ubuntu-latest
508-
runs-on: ubuntu-24.04-arm
509-
510-
steps:
511-
- name: Checkout repository
512-
uses: actions/checkout@v4
513-
with:
514-
path: main
515-
filter: "blob:none"
516-
517-
- name: Debloat Runner
518-
run: |
519-
#Presets
520-
set +x ; set +e
521-
#--------------#
522-
bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/main/Github/Runners/debloat_ubuntu.sh") --force
523-
continue-on-error: true
524-
525-
- name: Setup Env
526-
run: |
527-
#Presets
528-
set +x ; set +e
529-
#--------------#
530-
#Docker Tags
531-
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
532-
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
533-
#Copy dockerfiles
534-
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
535-
cp "${GITHUB_WORKSPACE}/main/Github/Runners/ubuntu-systemd-base.dockerfile" "/tmp/DOCKERFILES/ubuntu-systemd-base.dockerfile"
536-
continue-on-error: true
537-
538-
- name: Set up QEMU
539-
uses: docker/setup-qemu-action@v3
540-
continue-on-error: true
541-
542-
- name: Set up Docker Buildx
543-
uses: docker/setup-buildx-action@v3
544-
continue-on-error: true
545-
546-
- name: Login to Docker Hub
547-
uses: docker/login-action@v3
548-
with:
549-
username: "${{ secrets.DOCKERHUB_USERNAME }}"
550-
password: "${{ secrets.DOCKERHUB_TOKEN }}"
551-
continue-on-error: true
552-
553-
- name: Login to GHCR
554-
uses: docker/login-action@v3
555-
with:
556-
registry: ghcr.io
557-
username: "${{ github.actor }}"
558-
password: "${{ secrets.GITHUB_TOKEN }}"
559-
continue-on-error: true
560-
561-
#https://hub.docker.com/r/pkgforge/ubuntu-systemd-base
562-
- name: Docker Build and Push (Ubuntu-Systemd-Base)
563-
uses: docker/build-push-action@v6
564-
with:
565-
context: /tmp/DOCKERFILES/
566-
file: "/tmp/DOCKERFILES/ubuntu-systemd-base.dockerfile"
567-
platforms: "linux/arm64"
568-
build-args: |
569-
ARCH=aarch64
570-
tags: |
571-
pkgforge/ubuntu-systemd-base:aarch64
572-
pkgforge/ubuntu-systemd-base:aarch64-${{ env.DOCKER_TAG }}
573-
ghcr.io/pkgforge/devscripts/ubuntu-systemd-base:aarch64
574-
ghcr.io/pkgforge/devscripts/ubuntu-systemd-base:aarch64-${{ env.DOCKER_TAG }}
575-
push: true
502+
outputs: type=registry,compression=zstd,compression-level=22
576503
continue-on-error: true
577504
#------------------------------------------------------------------------------------#
578-
build-push-docker-ubuntu-base-riscv64:
579-
name: Push (Ubuntu-Base-riscv64) --> Docker Hub
505+
build-push-ubuntu-systemd-base:
506+
name: Push (Ubuntu-Base ${{ matrix.arch }}) --> Docker Hub
580507
needs: [build-push-ubuntu-builder]
581-
runs-on: ubuntu-latest
582-
583-
steps:
584-
- name: Checkout repository
585-
uses: actions/checkout@v4
586-
with:
587-
path: main
588-
filter: "blob:none"
589-
590-
- name: Debloat Runner
591-
run: |
592-
#Presets
593-
set +x ; set +e
594-
#--------------#
595-
bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/main/Github/Runners/debloat_ubuntu.sh") --force
596-
continue-on-error: true
597-
598-
- name: Setup Env
599-
run: |
600-
#Presets
601-
set +x ; set +e
602-
#--------------#
603-
#Docker Tags
604-
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="${DOCKER_TAG}"
605-
echo "DOCKER_TAG=${DOCKER_TAG}" >> "${GITHUB_ENV}"
606-
#Copy dockerfiles
607-
mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES"
608-
cp "${GITHUB_WORKSPACE}/main/Github/Runners/ubuntu-systemd-base.dockerfile" "/tmp/DOCKERFILES/ubuntu-systemd-base.dockerfile"
609-
continue-on-error: true
610-
611-
- name: Set up QEMU
612-
uses: docker/setup-qemu-action@v3
613-
continue-on-error: true
614-
615-
- name: Set up Docker Buildx
616-
uses: docker/setup-buildx-action@v3
617-
continue-on-error: true
618-
619-
- name: Login to Docker Hub
620-
uses: docker/login-action@v3
621-
with:
622-
username: "${{ secrets.DOCKERHUB_USERNAME }}"
623-
password: "${{ secrets.DOCKERHUB_TOKEN }}"
624-
continue-on-error: true
625-
626-
- name: Login to GHCR
627-
uses: docker/login-action@v3
628-
with:
629-
registry: ghcr.io
630-
username: "${{ github.actor }}"
631-
password: "${{ secrets.GITHUB_TOKEN }}"
632-
continue-on-error: true
508+
runs-on: ${{ matrix.runner }}
509+
strategy:
510+
matrix:
511+
include:
512+
- arch: aarch64
513+
platform: arm64
514+
runner: ubuntu-24.04-arm
515+
- arch: riscv64
516+
platform: riscv64
517+
runner: ubuntu-latest
518+
- arch: x86_64
519+
platform: amd64
520+
runner: ubuntu-latest
633521

634-
#https://hub.docker.com/r/pkgforge/ubuntu-systemd-base
635-
- name: Docker Build and Push (Ubuntu-Systemd-Base)
636-
uses: docker/build-push-action@v6
637-
with:
638-
context: /tmp/DOCKERFILES/
639-
file: "/tmp/DOCKERFILES/ubuntu-systemd-base.dockerfile"
640-
platforms: "linux/riscv64"
641-
build-args: |
642-
ARCH=riscv64
643-
tags: |
644-
pkgforge/ubuntu-systemd-base:riscv64
645-
pkgforge/ubuntu-systemd-base:riscv64-${{ env.DOCKER_TAG }}
646-
ghcr.io/pkgforge/devscripts/ubuntu-systemd-base:riscv64
647-
ghcr.io/pkgforge/devscripts/ubuntu-systemd-base:riscv64-${{ env.DOCKER_TAG }}
648-
push: true
649-
continue-on-error: true
650-
#------------------------------------------------------------------------------------#
651-
build-push-docker-ubuntu-base-x64:
652-
name: Push (Ubuntu-Base-x64) --> Docker Hub
653-
needs: [build-push-ubuntu-builder]
654-
runs-on: ubuntu-latest
655-
656522
steps:
657523
- name: Checkout repository
658524
uses: actions/checkout@v4
@@ -710,15 +576,15 @@ jobs:
710576
with:
711577
context: /tmp/DOCKERFILES/
712578
file: "/tmp/DOCKERFILES/ubuntu-systemd-base.dockerfile"
713-
platforms: "linux/amd64"
579+
platforms: "linux/${{ matrix.platform }}"
714580
build-args: |
715-
ARCH=x86_64
581+
ARCH=${{ matrix.arch }}
716582
tags: |
717-
pkgforge/ubuntu-systemd-base:x86_64
718-
pkgforge/ubuntu-systemd-base:x86_64-${{ env.DOCKER_TAG }}
719-
ghcr.io/pkgforge/devscripts/ubuntu-systemd-base:x86_64
720-
ghcr.io/pkgforge/devscripts/ubuntu-systemd-base:x86_64-${{ env.DOCKER_TAG }}
721-
push: true
583+
pkgforge/ubuntu-systemd-base:${{ matrix.arch }}
584+
pkgforge/ubuntu-systemd-base:${{ matrix.arch }}-${{ env.DOCKER_TAG }}
585+
ghcr.io/pkgforge/devscripts/ubuntu-systemd-base:${{ matrix.arch }}
586+
ghcr.io/pkgforge/devscripts/ubuntu-systemd-base:${{ matrix.arch }}-${{ env.DOCKER_TAG }}
587+
outputs: type=registry,compression=zstd,compression-level=22
722588
continue-on-error: true
723589
#------------------------------------------------------------------------------------#
724590
build-push-docker-runner-aarch64:

Github/Runners/ubuntu-builder.dockerfile

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
# syntax=docker/dockerfile:1
22
#------------------------------------------------------------------------------------#
33
# DOCKER HUB URL : https://hub.docker.com/r/pkgforge/ubuntu-builder
4-
FROM ubuntu:latest
4+
#FROM ubuntu:latest
55
#FROM ubuntu:rolling
6+
ARG ARCH
7+
FROM "ghcr.io/pkgforge/devscripts/ubuntu:${ARCH}"
68
#------------------------------------------------------------------------------------#
79
##Base Deps
810
ENV DEBIAN_FRONTEND="noninteractive"
911
RUN <<EOS
1012
#Base
11-
apt-get update -y
13+
apt update -y
1214
packages="apt-transport-https apt-utils bash ca-certificates coreutils curl dos2unix fdupes findutils git gnupg2 imagemagick jq locales locate moreutils nano ncdu p7zip-full rename rsync software-properties-common sudo texinfo tmux tree unzip util-linux xz-utils wget zip"
1315
#Install
14-
apt-get update -y -qq
16+
apt update -y -qq
1517
for pkg in $packages; do DEBIAN_FRONTEND="noninteractive" apt install -y --ignore-missing "$pkg"; done
1618
#Install_Re
1719
for pkg in $packages; do DEBIAN_FRONTEND="noninteractive" apt install -y --ignore-missing "$pkg"; done
1820
#unminimize : https://wiki.ubuntu.com/Minimal
21+
apt install unminimize -y -qq || true
1922
yes | unminimize
2023
#Python
21-
apt-get install python3 -y
24+
apt install python3 -y
2225
#Test
2326
python --version 2>/dev/null ; python3 --version 2>/dev/null
2427
#Install pip:
@@ -37,11 +40,11 @@ EOS
3740
##Systemd installation
3841
RUN <<EOS
3942
#SystemD
40-
apt-get update -y
43+
apt update -y
4144
packages="dbus iptables iproute2 libsystemd0 kmod systemd systemd-sysv udev"
4245
for pkg in $packages; do apt install -y --ignore-missing "$pkg"; done
4346
#Housekeeping
44-
apt-get clean -y
47+
apt clean -y
4548
rm -rf "/lib/systemd/system/getty.target" 2>/dev/null
4649
rm -rf "/lib/systemd/system/systemd"*udev* 2>/dev/null
4750
rm -rf "/usr/share/doc/"* 2>/dev/null
@@ -115,7 +118,7 @@ RUN <<EOS
115118
set +e
116119
packages="apt-transport-https apt-utils aria2 asciidoc asciidoctor attr autoconf autoconf-archive automake autopoint bc binutils bison bison++ bisonc++ b3sum brotli build-essential byacc ca-certificates ccache clang cmake cmake-data coreutils desktop-file-utils devscripts diffutils dnsutils dos2unix flex file findutils fontconfig gawk gcc git-lfs gnupg2 gettext help2man imagemagick itstool lzip jq libarchive-dev libargparse-dev libassuan-dev libbearssl-dev libblkid-dev libbpf-dev libbpfcc-dev libbrotli-dev libcap-dev libcapnp-dev libcapstone-dev libc-ares-dev libcmocka-dev libedit-dev libelf-dev libevent-dev libfuse-dev libfuse3-dev libharfbuzz-dev libhwloc-dev libidn-dev libidn2-dev libjemalloc-dev liblz-dev liblz4-dev liblzo*-dev libmagick*-*-dev libmpv-dev libndctl-dev libnvme-dev libpcre2-dev libpopt-dev libpsl-dev librust-lzma-sys-dev libsdl2-dev libseccomp-dev libselinux1-dev libsndio-dev libsodium-dev libsqlite3-dev libssh-dev libtool libtool-bin libunistring-dev liburing libusb-dev libwayland-dev libwolfssl-dev libx11-dev libx11-xcb-dev libxdp-dev libxi-dev libxkbcommon-dev libxmlb-dev libxv-dev libxxhash-dev libyaml-dev libzimg-dev libzstd-dev linux-headers-generic lzma lzma-dev make meson moreutils musl musl-dev musl-tools nasm nettle-dev npm patch patchelf pkg-config python3 python3-pip python3-venv p7zip-full qemu-user-static rsync scons software-properties-common spirv-cross sqlite3 sqlite3-pcre sqlite3-tools swig texinfo texi2html tree txt2html util-linux wget xsltproc xxhash xz-utils yasm zsync"
117120
#Install
118-
apt-get update -y -qq
121+
apt update -y -qq
119122
for pkg in $packages; do DEBIAN_FRONTEND="noninteractive" apt install -y --ignore-missing "$pkg"; done
120123
#Install_Re
121124
for pkg in $packages; do DEBIAN_FRONTEND="noninteractive" apt install -y --ignore-missing "$pkg"; done
@@ -132,19 +135,19 @@ RUN <<EOS
132135
apt install libpcap-dev pcaputils -y 2>/dev/null
133136
#----------------------#
134137
#libsqlite3
135-
apt-get install libsqlite3-dev sqlite3 sqlite3-pcre sqlite3-tools -y 2>/dev/null
138+
apt install libsqlite3-dev sqlite3 sqlite3-pcre sqlite3-tools -y 2>/dev/null
136139
#----------------------#
137140
#lzma
138-
apt-get install liblz-dev librust-lzma-sys-dev lzma lzma-dev -y
141+
apt install liblz-dev librust-lzma-sys-dev lzma lzma-dev -y
139142
#----------------------#
140143
#staticx: https://github.com/JonathonReinhart/staticx/blob/main/.github/workflows/build-test.yml
141144
export CWD="$(realpath .)" ; cd "$(mktemp -d)" >/dev/null 2>&1 ; realpath .
142145
#Switch to default: https://github.com/JonathonReinhart/staticx/pull/284
143146
git clone --filter "blob:none" "https://github.com/JonathonReinhart/staticx" --branch "add-type-checking" && cd "./staticx"
144147
#https://github.com/JonathonReinhart/staticx/blob/main/build.sh
145148
pip install -r "./requirements.txt" --break-system-packages --upgrade --force
146-
apt-get update -y
147-
apt-get install -y busybox musl-tools scons
149+
apt update -y
150+
apt install -y busybox musl-tools scons
148151
export BOOTLOADER_CC="musl-gcc"
149152
rm -rf "./build" "./dist" "./scons_build" "./staticx/assets"
150153
python "./setup.py" sdist bdist_wheel

Github/Runners/ubuntu-systemd-base.dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ FROM "ghcr.io/pkgforge/devscripts/ubuntu-builder:${ARCH}"
1010
ENV DEBIAN_FRONTEND="noninteractive"
1111
RUN <<EOS
1212
#Base
13-
apt-get update -y
13+
apt update -y
1414
packages="apt-transport-https apt-utils bash ca-certificates coreutils curl dos2unix fdupes findutils git gnupg2 imagemagick jq locales locate moreutils nano ncdu p7zip-full rename rsync software-properties-common texinfo sudo tmux tree unzip util-linux xz-utils wget zip"
1515
#Install
16-
apt-get update -y -qq
16+
apt update -y -qq
1717
for pkg in $packages; do DEBIAN_FRONTEND="noninteractive" apt install -y --ignore-missing "$pkg"; done
1818
#Install_Re
1919
for pkg in $packages; do DEBIAN_FRONTEND="noninteractive" apt install -y --ignore-missing "$pkg"; done
2020
#unminimize : https://wiki.ubuntu.com/Minimal
2121
yes | unminimize
2222
#Python
23-
apt-get install python3 -y
23+
apt install python3 -y
2424
#Test
2525
python --version 2>/dev/null ; python3 --version 2>/dev/null
2626
#Install pip:
@@ -39,7 +39,7 @@ EOS
3939
##Systemd installation
4040
RUN <<EOS
4141
#SystemD
42-
apt-get update -y
42+
apt update -y
4343
packages="dbus iptables iproute2 libsystemd0 kmod systemd systemd-sysv udev"
4444
for pkg in $packages; do apt install -y --ignore-missing "$pkg"; done
4545
##Prevents journald from reading kernel messages from /dev/kmsg
@@ -52,7 +52,7 @@ RUN <<EOS
5252
#systemctl mask "sys-kernel-debug.mount"
5353
#systemctl mask "sys-kernel-tracing.mount"
5454
#Housekeeping
55-
apt-get clean -y
55+
apt clean -y
5656
rm -rf "/lib/systemd/system/getty.target" 2>/dev/null
5757
rm -rf "/lib/systemd/system/systemd"*udev* 2>/dev/null
5858
rm -rf "/usr/share/doc/"* 2>/dev/null
@@ -179,7 +179,7 @@ RUN <<EOS
179179
#System has not been booted with systemd as init system (PID 1). Can't operate.
180180
#Failed to connect to bus: Host is down
181181
#Replace with patched
182-
apt-get install python3 -y
182+
apt install python3 -y
183183
# curl -qfsSL "https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py" -o "$(which systemctl)"
184184
mkdir -p "/var/run/dbus" ; dbus-daemon --config-file="/usr/share/dbus-1/system.conf" --print-address
185185
EOS
@@ -190,7 +190,7 @@ EOS
190190
RUN <<EOS
191191
##Install SSH
192192
set +e
193-
apt-get update -y && apt-get install openssh-server ssh -y
193+
apt update -y && apt install openssh-server ssh -y
194194
#Config
195195
mkdir -p "/run/sshd" ; mkdir -p "/etc/ssh" ; touch "/var/log/auth.log" "/var/log/btmp" 2>/dev/null || true
196196
mkdir -p "/root/.ssh" ; chown "root:root" "/root/.ssh"
@@ -240,7 +240,7 @@ EOS
240240
# echo "deb http://download.opensuse.org/repositories/home:/alvistack/xUbuntu_${VERSION}/ /" | tee "/etc/apt/sources.list.d/home:alvistack.list"
241241
# curl -fsSL "https://download.opensuse.org/repositories/home:alvistack/xUbuntu_${VERSION}/Release.key" | gpg --dearmor | tee "/etc/apt/trusted.gpg.d/home_alvistack.gpg" >/dev/null
242242
# apt update -y -qq ; apt install podman -y 2>/dev/null || true
243-
# apt-get install containernetworking-plugins podman-netavark -y 2>/dev/null || true
243+
# apt install containernetworking-plugins podman-netavark -y 2>/dev/null || true
244244
# systemctl enable podman --now 2>/dev/null || true
245245
#EOS
246246
##------------------------------------------------------------------------------------#

0 commit comments

Comments
 (0)