Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Pipeline Docker run - git@bitbucket.org: Permission denied (publickey).

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.

1 answer

0 votes

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

451 views 4 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you