kas-container: copy host ssh config into home

This patch fixes a regression introduced in 492b2c5. As the builder user
is no longer created in the entrypoint, the data from the home skeleton
is also not copied anymore. This breaks the ssh config (including
known_hosts) when using kas-container with --ssh-dir, as the ssh dir is
mounted into the skeleton, but not copied to the builders home.

With this patch, we now explicitly copy the .ssh folder into the builder
users home, in case it is mounted from the host.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Felix Moessbauer 2023-02-27 13:21:30 +01:00 committed by Jan Kiszka
parent b8576ee99e
commit f971cd363b

View File

@ -51,6 +51,10 @@ else
groupmod -o --gid "$GROUP_ID" builder
usermod -o --uid "$USER_ID" --gid "$GROUP_ID" builder >/dev/null
chown -R "$USER_ID":"$GROUP_ID" /builder
# copy host SSH config into home of builder
if [ -d /etc/skel/.ssh ]; then
cp -a /etc/skel/.ssh /builder/
fi
GOSU="gosu builder"
fi