Mounting /etc/passwd from host to container causes that any git command relying on ssh will use the user from /etc/passwd´ incl. the home directory. This directory does not exist in the container and therefore the git command (eg.git fetch origin docs:docs`) fails.
I tried to solve this by modifying the python-setup-py-build image which is generated in the very first stage by adding a user that can be injected via docker build-args. The idea was to avoid the mounting of /etc/passwd. But once the problem of writing to the home dir got solved I got hit by the host key verifiation error.
This kind of stuff is not really easy to solve in Jenkins and therefore I decided to do what we already do: pushing changes with git from host.
When using ssh checkouts one hits several issues:
Mounting
/etc/passwd
from host to container causes that any git command relying on ssh will use the user from/etc/passwd´ incl. the home directory. This directory does not exist in the container and therefore the git command (eg.
git fetch origin docs:docs`) fails.I tried to solve this by modifying the
python-setup-py-build
image which is generated in the very first stage by adding a user that can be injected via docker build-args. The idea was to avoid the mounting of/etc/passwd
. But once the problem of writing to the home dir got solved I got hit by thehost key verifiation
error.This kind of stuff is not really easy to solve in Jenkins and therefore I decided to do what we already do: pushing changes with git from host.
See as well related tickets on Jenkins side: https://issues.jenkins-ci.org/browse/JENKINS-47026