Skip to content

Commit 1c0c32a

Browse files
committed
more
1 parent 158dc35 commit 1c0c32a

File tree

5 files changed

+298
-0
lines changed

5 files changed

+298
-0
lines changed

.github/workflows/build_bootstrap_images_aarch64.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121
strategy:
2222
matrix:
2323
include:
24+
- image: "alpine-base"
25+
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/alpine.sh"
26+
arch: "aarch64"
27+
file: "/tmp/rootfs.tar"
28+
2429
- image: "archlinux-base"
2530
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/archlinux.sh"
2631
arch: "aarch64"
@@ -36,11 +41,21 @@ jobs:
3641
# arch: "aarch64"
3742
# file: "/tmp/rootfs.tar"
3843

44+
- image: "debian-base"
45+
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/debian.sh"
46+
arch: "aarch64"
47+
file: "/tmp/rootfs.tar"
48+
3949
- image: "eweos-base"
4050
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/eweos.sh"
4151
arch: "aarch64"
4252
file: "/tmp/rootfs.tar"
4353

54+
- image: "ubuntu-base"
55+
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/ubuntu.sh"
56+
arch: "aarch64"
57+
file: "/tmp/rootfs.tar"
58+
4459
steps:
4560
- name: Checkout repository
4661
uses: actions/checkout@v4

.github/workflows/build_bootstrap_images_x86_64.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ jobs:
2020
strategy:
2121
matrix:
2222
include:
23+
- image: "alpine-base"
24+
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/alpine.sh"
25+
arch: "x86_64"
26+
file: "/tmp/rootfs.tar"
27+
2328
- image: "archlinux-base"
2429
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/archlinux.sh"
2530
arch: "x86_64"
@@ -35,11 +40,21 @@ jobs:
3540
arch: "x86_64"
3641
file: "/tmp/rootfs.tar"
3742

43+
- image: "debian-base"
44+
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/debian.sh"
45+
arch: "x86_64"
46+
file: "/tmp/rootfs.tar"
47+
3848
- image: "eweos-base"
3949
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/eweos.sh"
4050
arch: "x86_64"
4151
file: "/tmp/rootfs.tar"
4252

53+
- image: "ubuntu-base"
54+
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/ubuntu.sh"
55+
arch: "x86_64"
56+
file: "/tmp/rootfs.tar"
57+
4358
steps:
4459
- name: Checkout repository
4560
uses: actions/checkout@v4

Github/Runners/bootstrap/alpine.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env bash
2+
#
3+
##DO NOT RUN DIRECTLY
4+
##Self: bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/bootstrap/alpine.sh")
5+
#-------------------------------------------------------#
6+
7+
#-------------------------------------------------------#
8+
set -x
9+
#-------------------------------------------------------#
10+
11+
#-------------------------------------------------------#
12+
##Bootstrap
13+
pushd "$(mktemp -d)" >/dev/null 2>&1
14+
docker stop "alpine-base" 2>/dev/null ; docker rm "alpine-base" 2>/dev/null
15+
docker run --name "alpine-base" --privileged "alpine:edge" sh -l -c '
16+
#Bootstrap
17+
apk update --no-interactive
18+
apk upgrade --no-interactive
19+
apk add bash binutils curl fakeroot musl-locales-lang wget --latest --upgrade --no-interactive
20+
#apk add bash alsa-utils alsa-utils-doc alsa-lib alsaconf alsa-ucm-conf pulseaudio pulseaudio-alsa --latest --upgrade --no-interactive
21+
#Fix & Patches
22+
chmod 755 "/bin/bbsuid" 2>/dev/null
23+
echo -e "nameserver 8.8.8.8\nnameserver 2620:0:ccc::2" | tee "/etc/resolv.conf"
24+
echo -e "nameserver 1.1.1.1\nnameserver 2606:4700:4700::1111" | tee -a "/etc/resolv.conf"
25+
mkdir -pv "/etc/apk"
26+
echo "https://dl-cdn.alpinelinux.org/alpine/edge/main" | tee "/etc/apk/repositories"
27+
echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" | tee -a "/etc/apk/repositories"
28+
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" | tee -a "/etc/apk/repositories"
29+
echo "LANG=en_US.UTF-8" | tee "/etc/locale.conf"
30+
echo "LANG=en_US.UTF-8" | tee -a "/etc/locale.conf"
31+
echo "LANGUAGE=en_US:en" | tee -a "/etc/locale.conf"
32+
echo "LC_ALL=en_US.UTF-8" | tee -a "/etc/locale.conf"
33+
locale-gen
34+
locale-gen "en_US.UTF-8"
35+
#Cleanup
36+
rm -rfv "/"{tmp,proc,sys,dev,run}
37+
mkdir -pv "/"{tmp,proc,sys,dev,run/media,mnt,media,home}
38+
rm -fv /etc/{host.conf,hosts,passwd,group,nsswitch.conf}
39+
touch /etc/{host.conf,hosts,passwd,group,nsswitch.conf}
40+
apk info -L
41+
rm -rfv "/var/cache/apk/"*'
42+
##Export
43+
docker export "$(docker ps -aqf 'name=alpine-base')" --output "rootfs.tar"
44+
if [[ -f "./rootfs.tar" ]] && [[ $(stat -c%s "./rootfs.tar") -gt 10000 ]]; then
45+
rsync -achLv --mkpath "./rootfs.tar" "/tmp/rootfs.tar"
46+
else
47+
echo "\n[-] FATAL: Failed to export ROOTFS\n"
48+
exit 1
49+
fi
50+
popd "$(mktemp -d)" >/dev/null 2>&1
51+
#-------------------------------------------------------#
52+
53+
54+
#-------------------------------------------------------#
55+
##Push
56+
#ENV
57+
D_ID="$(docker ps -aqf 'name=alpine-base' | tr -d '[:space:]')"
58+
D_TAG="v$(date +'%Y.%m.%d' | tr -d '[:space:]')"
59+
export D_ID D_TAG
60+
#Tags
61+
docker commit "${D_ID}" "pkgforge/alpine-base:latest"
62+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/alpine-base:latest"
63+
docker commit "${D_ID}" "pkgforge/alpine-base:${D_TAG}"
64+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/alpine-base:${D_TAG}"
65+
docker commit "${D_ID}" "pkgforge/alpine-base:$(uname -m)"
66+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/alpine-base:$(uname -m)"
67+
#Push
68+
docker push "pkgforge/alpine-base:latest"
69+
docker push "ghcr.io/pkgforge/devscripts/alpine-base:latest"
70+
docker push "pkgforge/alpine-base:${D_TAG}"
71+
docker push "ghcr.io/pkgforge/devscripts/alpine-base:${D_TAG}"
72+
docker push "pkgforge/alpine-base:$(uname -m)"
73+
docker push "ghcr.io/pkgforge/devscripts/alpine-base:$(uname -m)"
74+
#-------------------------------------------------------#

Github/Runners/bootstrap/debian.sh

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env bash
2+
#
3+
##DO NOT RUN DIRECTLY
4+
##Self: bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/bootstrap/debian.sh")
5+
#-------------------------------------------------------#
6+
7+
#-------------------------------------------------------#
8+
set -x
9+
#-------------------------------------------------------#
10+
11+
#-------------------------------------------------------#
12+
##Bootstrap
13+
pushd "$(mktemp -d)" >/dev/null 2>&1
14+
docker stop "debian-base" 2>/dev/null ; docker rm "debian-base" 2>/dev/null
15+
docker run --name "debian-base" --privileged "debian:stable-slim" sh -l -c '
16+
#Bootstrap
17+
#echo -e "nameserver 8.8.8.8\nnameserver 2620:0:ccc::2" | tee "/etc/resolv.conf"
18+
#echo -e "nameserver 1.1.1.1\nnameserver 2606:4700:4700::1111" | tee -a "/etc/resolv.conf"
19+
unlink "/var/lib/dbus/machine-id" 2>/dev/null
20+
unlink "/etc/machine-id" 2>/dev/null
21+
rm -rvf "/etc/machine-id"
22+
systemd-machine-id-setup --print 2>/dev/null | tee "/var/lib/dbus/machine-id"
23+
ln --symbolic --force --relative "/var/lib/dbus/machine-id" "/etc/machine-id"
24+
echo "LANG=en_US.UTF-8" | tee "/etc/locale.conf"
25+
echo "LANG=en_US.UTF-8" | tee -a "/etc/locale.conf"
26+
echo "LANGUAGE=en_US:en" | tee -a "/etc/locale.conf"
27+
echo "LC_ALL=en_US.UTF-8" | tee -a "/etc/locale.conf"
28+
echo "en_US.UTF-8 UTF-8" | tee -a "/etc/locale.gen"
29+
echo "LC_ALL=en_US.UTF-8" | tee -a "/etc/environment"
30+
chown -R _apt:root /var/cache/apt/archives/partial/
31+
dpkg-statoverride --remove /usr/bin/crontab
32+
DEBIAN_FRONTEND="noninteractive" apt update -y
33+
DEBIAN_FRONTEND="noninteractive" apt install bash binutils coreutils curl fakeroot git locales sudo wget -y --no-install-recommends --ignore-missing
34+
locale-gen "en_US.UTF-8"
35+
echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections
36+
apt purge locales perl -y ; apt autoremove -y ; apt autoclean -y
37+
apt list --installed
38+
apt clean -y
39+
find "/boot" -mindepth 1 -delete 2>/dev/null
40+
find "/dev" -mindepth 1 -delete 2>/dev/null
41+
find "/proc" -mindepth 1 -delete 2>/dev/null
42+
find "/run" -mindepth 1 -delete 2>/dev/null
43+
find "/sys" -mindepth 1 -delete 2>/dev/null
44+
find "/tmp" -mindepth 1 -delete 2>/dev/null
45+
find "/usr/include" -mindepth 1 -delete 2>/dev/null
46+
find "/usr/lib" -type f -name "*.a" -print -exec rm -rfv "{}" 2>/dev/null \; 2>/dev/null
47+
find "/usr/lib32" -type f -name "*.a" -print -exec rm -rfv "{}" 2>/dev/null \; 2>/dev/null
48+
find "/usr/share/locale" -mindepth 1 -maxdepth 1 ! -regex '\''.*/\(locale.alias\|en\|en_US\)$'\'' -exec rm -rfv "{}" + 2>/dev/null
49+
find "/usr/share/doc" -mindepth 1 -delete 2>/dev/null
50+
find "/usr/share/gtk-doc" -mindepth 1 -delete 2>/dev/null
51+
find "/usr/share/help" -mindepth 1 -delete 2>/dev/null
52+
find "/usr/share/info" -mindepth 1 -delete 2>/dev/null
53+
find "/usr/share/man" -mindepth 1 -delete 2>/dev/null
54+
find "/" -type d -name "__pycache__" -exec rm -rfv "{}" \; 2>/dev/null
55+
find "/" -type f -name "*.pacnew" -exec rm -rfv "{}" \; 2>/dev/null
56+
find "/" -type f -name "*.pacsave" -exec rm -rfv "{}" \; 2>/dev/null
57+
find "/var/log" -type f -name "*.log" -exec rm -rfv "{}" \; 2>/dev/null
58+
rm -rfv "/var/lib/apt/lists/"*
59+
rm -rfv "/var/cache/apt/"*
60+
rm -rfv "/"{tmp,proc,sys,dev,run}
61+
mkdir -pv "/"{tmp,proc,sys,dev,run/media,mnt,media,home}
62+
rm -fv /etc/{host.conf,hosts,passwd,group,nsswitch.conf}
63+
touch /etc/{host.conf,hosts,passwd,group,nsswitch.conf}'
64+
##Export
65+
docker export "$(docker ps -aqf 'name=debian-base')" --output "rootfs.tar"
66+
if [[ -f "./rootfs.tar" ]] && [[ $(stat -c%s "./rootfs.tar") -gt 10000 ]]; then
67+
rsync -achLv --mkpath "./rootfs.tar" "/tmp/rootfs.tar"
68+
else
69+
echo "\n[-] FATAL: Failed to export ROOTFS\n"
70+
exit 1
71+
fi
72+
popd "$(mktemp -d)" >/dev/null 2>&1
73+
#-------------------------------------------------------#
74+
75+
76+
#-------------------------------------------------------#
77+
##Push
78+
#ENV
79+
D_ID="$(docker ps -aqf 'name=debian-base' | tr -d '[:space:]')"
80+
D_TAG="v$(date +'%Y.%m.%d' | tr -d '[:space:]')"
81+
export D_ID D_TAG
82+
#Tags
83+
docker commit "${D_ID}" "pkgforge/debian-base:latest"
84+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/debian-base:latest"
85+
docker commit "${D_ID}" "pkgforge/debian-base:${D_TAG}"
86+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/debian-base:${D_TAG}"
87+
docker commit "${D_ID}" "pkgforge/debian-base:$(uname -m)"
88+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/debian-base:$(uname -m)"
89+
#Push
90+
docker push "pkgforge/debian-base:latest"
91+
docker push "ghcr.io/pkgforge/devscripts/debian-base:latest"
92+
docker push "pkgforge/debian-base:${D_TAG}"
93+
docker push "ghcr.io/pkgforge/devscripts/debian-base:${D_TAG}"
94+
docker push "pkgforge/debian-base:$(uname -m)"
95+
docker push "ghcr.io/pkgforge/devscripts/debian-base:$(uname -m)"
96+
#-------------------------------------------------------#

Github/Runners/bootstrap/ubuntu.sh

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/usr/bin/env bash
2+
#
3+
##DO NOT RUN DIRECTLY
4+
##Self: bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/bootstrap/ubuntu.sh")
5+
#-------------------------------------------------------#
6+
7+
#-------------------------------------------------------#
8+
## https://github.com/phusion/baseimage-docker
9+
# https://hub.docker.com/r/phusion/baseimage/tags
10+
set -x
11+
#-------------------------------------------------------#
12+
13+
#-------------------------------------------------------#
14+
##Bootstrap
15+
pushd "$(mktemp -d)" >/dev/null 2>&1
16+
docker stop "ubuntu-base" 2>/dev/null ; docker rm "ubuntu-base" 2>/dev/null
17+
docker run --name "ubuntu-base" --privileged "phusion/baseimage:noble-1.0.0" sh -l -c '
18+
#Bootstrap
19+
#echo -e "nameserver 8.8.8.8\nnameserver 2620:0:ccc::2" | tee "/etc/resolv.conf"
20+
#echo -e "nameserver 1.1.1.1\nnameserver 2606:4700:4700::1111" | tee -a "/etc/resolv.conf"
21+
unlink "/var/lib/dbus/machine-id" 2>/dev/null
22+
unlink "/etc/machine-id" 2>/dev/null
23+
rm -rvf "/etc/machine-id"
24+
systemd-machine-id-setup --print 2>/dev/null | tee "/var/lib/dbus/machine-id"
25+
ln --symbolic --force --relative "/var/lib/dbus/machine-id" "/etc/machine-id"
26+
echo "LANG=en_US.UTF-8" | tee "/etc/locale.conf"
27+
echo "LANG=en_US.UTF-8" | tee -a "/etc/locale.conf"
28+
echo "LANGUAGE=en_US:en" | tee -a "/etc/locale.conf"
29+
echo "LC_ALL=en_US.UTF-8" | tee -a "/etc/locale.conf"
30+
echo "en_US.UTF-8 UTF-8" | tee -a "/etc/locale.gen"
31+
echo "LC_ALL=en_US.UTF-8" | tee -a "/etc/environment"
32+
chown -R _apt:root /var/cache/apt/archives/partial/
33+
dpkg-statoverride --remove /usr/bin/crontab
34+
ubuntu_FRONTEND="noninteractive" apt update -y
35+
ubuntu_FRONTEND="noninteractive" apt install bash binutils coreutils curl fakeroot git locales sudo wget -y --no-install-recommends --ignore-missing
36+
locale-gen "en_US.UTF-8"
37+
echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections
38+
apt purge locales perl -y ; apt autoremove -y ; apt autoclean -y
39+
apt list --installed
40+
apt clean -y
41+
find "/boot" -mindepth 1 -delete 2>/dev/null
42+
find "/dev" -mindepth 1 -delete 2>/dev/null
43+
find "/proc" -mindepth 1 -delete 2>/dev/null
44+
find "/run" -mindepth 1 -delete 2>/dev/null
45+
find "/sys" -mindepth 1 -delete 2>/dev/null
46+
find "/tmp" -mindepth 1 -delete 2>/dev/null
47+
find "/usr/include" -mindepth 1 -delete 2>/dev/null
48+
find "/usr/lib" -type f -name "*.a" -print -exec rm -rfv "{}" 2>/dev/null \; 2>/dev/null
49+
find "/usr/lib32" -type f -name "*.a" -print -exec rm -rfv "{}" 2>/dev/null \; 2>/dev/null
50+
find "/usr/share/locale" -mindepth 1 -maxdepth 1 ! -regex '\''.*/\(locale.alias\|en\|en_US\)$'\'' -exec rm -rfv "{}" + 2>/dev/null
51+
find "/usr/share/doc" -mindepth 1 -delete 2>/dev/null
52+
find "/usr/share/gtk-doc" -mindepth 1 -delete 2>/dev/null
53+
find "/usr/share/help" -mindepth 1 -delete 2>/dev/null
54+
find "/usr/share/info" -mindepth 1 -delete 2>/dev/null
55+
find "/usr/share/man" -mindepth 1 -delete 2>/dev/null
56+
find "/" -type d -name "__pycache__" -exec rm -rfv "{}" \; 2>/dev/null
57+
find "/" -type f -name "*.pacnew" -exec rm -rfv "{}" \; 2>/dev/null
58+
find "/" -type f -name "*.pacsave" -exec rm -rfv "{}" \; 2>/dev/null
59+
find "/var/log" -type f -name "*.log" -exec rm -rfv "{}" \; 2>/dev/null
60+
rm -rfv "/var/lib/apt/lists/"*
61+
rm -rfv "/var/cache/apt/"*
62+
rm -rfv "/"{tmp,proc,sys,dev,run}
63+
mkdir -pv "/"{tmp,proc,sys,dev,run/media,mnt,media,home}
64+
rm -fv /etc/{host.conf,hosts,passwd,group,nsswitch.conf}
65+
touch /etc/{host.conf,hosts,passwd,group,nsswitch.conf}'
66+
##Export
67+
docker export "$(docker ps -aqf 'name=ubuntu-base')" --output "rootfs.tar"
68+
if [[ -f "./rootfs.tar" ]] && [[ $(stat -c%s "./rootfs.tar") -gt 10000 ]]; then
69+
rsync -achLv --mkpath "./rootfs.tar" "/tmp/rootfs.tar"
70+
else
71+
echo "\n[-] FATAL: Failed to export ROOTFS\n"
72+
exit 1
73+
fi
74+
popd "$(mktemp -d)" >/dev/null 2>&1
75+
#-------------------------------------------------------#
76+
77+
78+
#-------------------------------------------------------#
79+
##Push
80+
#ENV
81+
D_ID="$(docker ps -aqf 'name=ubuntu-base' | tr -d '[:space:]')"
82+
D_TAG="v$(date +'%Y.%m.%d' | tr -d '[:space:]')"
83+
export D_ID D_TAG
84+
#Tags
85+
docker commit "${D_ID}" "pkgforge/ubuntu-base:latest"
86+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/ubuntu-base:latest"
87+
docker commit "${D_ID}" "pkgforge/ubuntu-base:${D_TAG}"
88+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/ubuntu-base:${D_TAG}"
89+
docker commit "${D_ID}" "pkgforge/ubuntu-base:$(uname -m)"
90+
docker commit "${D_ID}" "ghcr.io/pkgforge/devscripts/ubuntu-base:$(uname -m)"
91+
#Push
92+
docker push "pkgforge/ubuntu-base:latest"
93+
docker push "ghcr.io/pkgforge/devscripts/ubuntu-base:latest"
94+
docker push "pkgforge/ubuntu-base:${D_TAG}"
95+
docker push "ghcr.io/pkgforge/devscripts/ubuntu-base:${D_TAG}"
96+
docker push "pkgforge/ubuntu-base:$(uname -m)"
97+
docker push "ghcr.io/pkgforge/devscripts/ubuntu-base:$(uname -m)"
98+
#-------------------------------------------------------#

0 commit comments

Comments
 (0)