fix(buildah): chmod and chattr not working

This commit is contained in:
phoenix 2025-04-17 13:52:39 +01:00
parent 6b0d3525cd
commit bd2db4ad39

View File

@ -11,15 +11,14 @@ DEV_HOME=/home/$DEV_USER
ctr=$(buildah from registry.fedoraproject.org/fedora-minimal:42)
buildah run "$ctr" -- bash -c "
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 && \
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 && chown $DEV_USER:$DEV_USER /tmp/tmux-shared \
mkdir -p $DEV_HOME/.gnupg && chmod 700 $DEV_HOME/.gnupg && \
chown $DEV_USER:$DEV_USER $DEV_HOME/.gnupg
chmod 750 /tmp/tmux-shared && \
mkdir -p $DEV_HOME/.gnupg && chmod 700 $DEV_HOME/.gnupg
"
# copy start script
buildah copy "$ctr" start.sh /start.sh
@ -36,9 +35,7 @@ buildah copy "$ctr" local $DEV_HOME/.local
buildah run "$ctr" -- bash -c "
find $DEV_HOME -type f -exec chmod 400 {} + && \
find $DEV_HOME -type d -exec chmod 500 {} + && \
find $DEV_HOME -mindepth 1 -exec chattr +i {} + && \
chmod -R 500 $SECURE && \
chattr -R +i $SECURE && \
chmod 511 /start.sh
"