Forums

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

Access private repository inside Dockerfile

Sajjad Zaheri
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!
November 25, 2023

Hi. I'm using a private bitbucket repository in same workspace inside another repository which contains my Node.js project as follows:

{
  "dependencies": {
    "example-dependency": "git+ssh://git@bitbucket.org:example-workspace/example-dependency.git"
  }
}

I had also created an SSH key in Pipelines->SSH Keys in my Node.js project repository and passed public key into example's repository Access Keys.

Although I'm passing "--ssh default=$BITBUCKET_SSH_KEY_FILE" to build docker command in bitbucket pipelines, still "npm ci" command inside my Dockerfile fails.

So, how can i access a private repository inside docker container?

1 answer

1 vote
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 26, 2023

Hi @Sajjad Zaheri

Welcome to the community.

You can check this existing knowledge-based article on how to pass SSH key variable from Bitbucket Pipelines to a Dockerfile where you can use the SSH key to access your your private repository.

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events