I have a Dockerfile within my repository, which I use to build our code. In order to build the code, I need to clone other bitbucket repositories.
I've been developing from inside the same container, and have been able to clone/pull without problems locally.
I also had some problems with authenticating the host, but I solved this by adding
`echo "bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==" >> ~/.ssh/known_hosts`
in my dockerfile.
The problem is that when running on the pipe, it fails to authenticate. However, if on the same build step, I try to clone the repository, it'll do it without any problems. So, I know the ssh keys are set correctly.
There's a similar post open https://community.atlassian.com/t5/Bitbucket-questions/Dockerfile-Host-key-verification-failed/qaq-p/1035415 , but also with no answer, and I also have the same issue that the known_hosts or config are not available to my docker in docker. As well, as trying to mount them brings a "forbidden"
Any help would be appreciated.
Try to add this command:
ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
Unfortunately, this is only useful when I get host validation errors, I'm past that point. The problem is that my ssh-agent is not forwarded to my docker, and I can't copy the config or known_hosts.
but thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.