Dockerfile.isar: support of sbuild

Upcoming support of sbuild in Isar requires some additional tools
to be preinstalled.

Also, `builder` user should be in `sbuild` group.

Additionally, to use external volume for schroot overlay because
the 'upper' overlayfs layer of sbuild can't be based on another
overlayfs filesystem that happens in case of using Docker.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Uladzimir Bely 2022-01-28 12:56:00 +01:00 committed by Jan Kiszka
parent 6abf837eab
commit 54ab356f9f
2 changed files with 6 additions and 0 deletions

View File

@ -12,8 +12,10 @@ RUN apt-get update && \
autoconf automake gdisk libtool bash-completion \
reprepro python3 binfmt-support e2fsprogs \
umoci skopeo \
git-buildpackage pristine-tar schroot sbuild debhelper \
multistrap qemu-user-static debootstrap quilt && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN sed -i 's|\tGOSU="gosu builder"|\0\n\tsbuild-adduser builder|' /kas/container-entrypoint
RUN sed -i 's|#!/bin/bash|\0\n\nupdate-binfmts --enable \&\& [ -f /proc/sys/fs/binfmt_misc/status ]|' /kas/container-entrypoint

View File

@ -91,6 +91,10 @@ enable_isar_mode() {
KAS_CONTAINER_IMAGE_NAME_DEFAULT="kas-isar"
KAS_ISAR_ARGS="--privileged"
SCHROOT_OVERLAY_DIR="${KAS_BUILD_DIR}/tmp/schroot-overlay"
trace mkdir -p "${SCHROOT_OVERLAY_DIR}"
KAS_ISAR_ARGS="${KAS_ISAR_ARGS} -v ${SCHROOT_OVERLAY_DIR}:/var/lib/schroot/union/overlay:rw"
if [ "${KAS_CONTAINER_ENGINE}" = "podman" ]; then
# sudo is needed for a privileged podman container
KAS_CONTAINER_COMMAND="sudo ${KAS_CONTAINER_COMMAND}"