initial work

This commit is contained in:
bwees
2025-08-12 16:48:14 -05:00
commit a5aed7d76f
7 changed files with 135 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
overlay/usr/app/images/*.tar
immich.apkovl.tar.gz
mkimage.sh
+32
View File
@@ -0,0 +1,32 @@
Steps to build:
1. Fire up a local alpine image on Docker:
```bash
docker run --rm -it -v "$(pwd)":/home alpine sh
```
2. Inside the container, run
```bash
apk add alpine-sdk abuild
```
3. Run
```bash
tar --numeric-owner --owner=0 --group=0 -cf root-overlay.tar -C overlay .
```
3. Run
```bash
./mkimage.sh --tag immich \
--outdir out \
--arch x86_64 \
--repository https://dl-cdn.alpinelinux.org/alpine/latest-stable/main \
--profile immich
```
4.
+5
View File
@@ -0,0 +1,5 @@
profile_immich() {
profile_standard
apks="$apks docker docker-compose"
apkovl="immich.apkovl.tar.gz"
}
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
rc-update add docker boot
service docker start
View File
+73
View File
@@ -0,0 +1,73 @@
#!/bin/sh -e
HOSTNAME="$1"
if [ -z "$HOSTNAME" ]; then
echo "usage: $0 hostname"
exit 1
fi
cleanup() {
rm -rf "$tmp"
}
makefile() {
OWNER="$1"
PERMS="$2"
FILENAME="$3"
cat > "$FILENAME"
chown "$OWNER" "$FILENAME"
chmod "$PERMS" "$FILENAME"
}
rc_add() {
mkdir -p "$tmp"/etc/runlevels/"$2"
ln -sf /etc/init.d/"$1" "$tmp"/etc/runlevels/"$2"/"$1"
}
tmp="$(mktemp -d)"
trap cleanup EXIT
mkdir -p "$tmp"/etc
makefile root:root 0644 "$tmp"/etc/hostname <<EOF
$HOSTNAME
EOF
mkdir -p "$tmp"/etc/network
makefile root:root 0644 "$tmp"/etc/network/interfaces <<EOF
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
EOF
mkdir -p "$tmp"/etc/apk
makefile root:root 0644 "$tmp"/etc/apk/world <<EOF
alpine-base
docker
docker-compose
EOF
rc_add devfs sysinit
rc_add dmesg sysinit
rc_add mdev sysinit
rc_add hwdrivers sysinit
rc_add modloop sysinit
rc_add hwclock boot
rc_add modules boot
rc_add sysctl boot
rc_add hostname boot
rc_add bootmisc boot
rc_add syslog boot
rc_add docker boot
rc_add mount-ro shutdown
rc_add killprocs shutdown
rc_add savecache shutdown
# copy all directories from overlay/ into $tmp and merge
cp -a overlay/. "$tmp"/
tar -c -C "$tmp" etc usr | gzip -9n > $HOSTNAME.apkovl.tar.gz
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
# Array of Docker image tags
images=(
"ghcr.io/immich-app/immich-server:v1.137.3"
"ghcr.io/immich-app/immich-machine-learning:v1.137.3"
"docker.io/valkey/valkey:8-bookworm"
"ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0"
)
# Pull each image sequentially
for img in "${images[@]}"; do
echo "Pulling $img..."
docker pull "$img"
docker save "$img" -o "overlay/usr/app/images/${img//[:\/]/_}.tar"
done
echo "All images pulled successfully."