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

Unable to connect to bitbucket via ssh using docker-compose

Aron Greenspan September 14, 2021

docker-compose file:

ARG SSH_PRIVATE_KEY
RUN mkdir ~/.ssh/
RUN echo "${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa
RUN chmod 600 ~/.ssh/id_rsa
RUN ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts

getting:


git@bitbucket.org: Permission denied (publickey). 

 when reaching the yarn install command

2 answers

1 accepted

0 votes
Answer accepted
Aron Greenspan September 20, 2021

It was because the ssh key i'd used had been created with a passphrase. I made a new one without and it worked without issue.

0 votes
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 20, 2021

Hi @Aron Greenspan

Welcome to the community.

To debug your Docker composer container further, would you be able to add the below command?

ssh -Tvv git@bitbucket.org

This will give you more information about the "Permission denied" error message you're getting.
Let me know how it goes.

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events