kas-isar: Rework isar-specific entrypoint setup

Leave the isar-only commands commented-out in the container-entrypoint
and simply remove the comment when building kas-isar. This is simpler,
more readable and also more robust against changes of the entrypoint
file.

While at it, avoid a separate layer for modifying container-entrypoint.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2023-02-05 20:56:06 +01:00
parent 6b1df5f425
commit a596e2ac33
2 changed files with 6 additions and 4 deletions

View File

@ -48,10 +48,8 @@ RUN apt-get update && \
git-buildpackage pristine-tar sbuild schroot \
umoci skopeo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN sed -i 's|\tGOSU="gosu builder"|\0\n\tsbuild-adduser builder >/dev/null 2>\&1|' /kas/container-entrypoint
RUN sed -i 's|#!/bin/bash|\0\n\nupdate-binfmts --enable \&\& [ -f /proc/sys/fs/binfmt_misc/status ]|' /kas/container-entrypoint
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
sed -i 's|# kas-isar: ||g' /kas/container-entrypoint
FROM kas-base as kas

View File

@ -1,5 +1,7 @@
#!/bin/bash
# kas-isar: update-binfmts --enable && [ -f /proc/sys/fs/binfmt_misc/status ]
if mount | grep -q "on / type aufs"; then
cat <<EOF >&2
WARNING: Generation of wic images will fail!
@ -32,6 +34,8 @@ else
fi
GOSU="gosu builder"
# kas-isar: sbuild-adduser builder >/dev/null 2>&1
fi
if [ "$PWD" = / ]; then