I have a docker container whose job it is to push a file to a git repository.
It refuses to connect to the git repository with the error.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have tried adding my known_hosts file (which pushes and pulls from the git repo just fine) to the docker using
RUN mkdir ~/.ssh
ADD known_hosts ~/.ssh/known_hosts
But still get the same error. ssh-keygen returns no output, and
'GIT_SSH_COMMAND="ssh -o \'UserKnownHostsFile=/dev/null\' -i ./ssh_id" git push origin master'
didn't fix it either. How can I disable host key verification so that I stop seeing this error?