From a596e2ac33285dabd97c50234c3b1a14e92f933a Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sun, 5 Feb 2023 20:56:06 +0100 Subject: [PATCH] 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 --- Dockerfile | 6 ++---- container-entrypoint | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 550dbdc..34fe9dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/container-entrypoint b/container-entrypoint index 7f465e9..2de4346 100755 --- a/container-entrypoint +++ b/container-entrypoint @@ -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 <&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