Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I do a Golang build that uses private repos inside a docker build?

andrew.vos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 2, 2026

I have a docker build that needs to `go get` and pull some packages from private repos.

I'm running using the default Atlassian image, and it is able to build the binary outside of docker, but when I do `docker build` I don't have access to the same ssh keys.

How can I copy these keys inside the docker build? I can't find any keys in `/root/.ssh` or in any other location?

 

1 answer

0 votes
Aron Gombas _Midori_
Community Champion
January 5, 2026

Hmm, isn't this approach (passing the SSH keys to the Docker file) that you should be following?

https://support.atlassian.com/bitbucket-cloud/kb/passing-ssh-key-variable-from-bitbucket-pipelines-to-a-dockerfile/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events