We have a Docker image with Git client installed.
The task is to automatically clone a repository when running a container from this image.
git clone – fatal: unable to fork
When running the
git clone command in a container from this Docker image it fails with the “unable to fork” error:
The cause is that
git uses SSH for authentication here (firstname.lastname@example.org), but we have no ssh client installed in the image:
The authenticity of host ‘github.com’ can’t be established
Another issue when automating
git clone – it’s asking to confirm the RSA key from the github.com host:
The authenticity of host ‘github.com (18.104.22.168)’ can’t be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
To solve this – need to add its public key to the
ssh-keyscan for this:
And now clone the repository: