feat(buildah): move to archlinux for better familiarity

This commit is contained in:
yeti 2025-04-17 16:02:19 +01:00
parent c843c140d9
commit a62208b1fd

View File

@ -9,12 +9,12 @@ DEV_USER=devuser
SECURE=/opt/secure
DEV_HOME=/home/$DEV_USER
ctr=$(buildah from registry.fedoraproject.org/fedora-minimal:42)
ctr=$(buildah from archlinux)
buildah run "$ctr" -- bash -c "\
microdnf update -y && microdnf install -y neovim git zsh tmux podman \
fzf fd ripgrep java-devel maven gnupg attr && \
microdnf clean all && useradd -ms /bin/zsh $DEV_USER && \
pacman -Sy --noconfirm && pacman -S --noconfirm neovim git zsh tmux podman \
fzf fd ripgrep jdk-openjdk && pacman -Scc --noconfirm \
useradd -ms /bin/zsh $DEV_USER && \
useradd --system --no-create-home --shell /usr/sbin/nologin viewer && \
usermod -aG $DEV_USER viewer && mkdir -p /tmp/tmux-shared && \
chmod 750 /tmp/tmux-shared && \
@ -36,14 +36,14 @@ buildah run "$ctr" -- bash -c "
find $DEV_HOME -type f -exec chmod 400 {} + && \
find $DEV_HOME -type d -exec chmod 500 {} + && \
chmod -R 500 $SECURE && \
chmod 511 /start.sh
chmod +x /start.sh
"
buildah config \
--user $DEV_USER \
--workingdir /app \
--env CONTAINER_HOST=unix:///run/podman/podman.sock \
--cmd ["$DEV_HOME/start.sh"] \
--cmd "/start.sh" \
"$ctr"
buildah commit "$ctr" $IMG_NAME