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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,464,912
Community Members
 
Community Events
176
Community Groups

Node installation with docker not working

Edited

I tried to create a Dockerfile for my project. I also installed an external git repository using ssh. When building the project, this error occurred.

 > [builder 6/8] RUN --mount=type=ssh npm ci:
#13 81.97 npm notice
#13 81.97 npm notice New minor version of npm available! 8.11.0 -> 8.15.0
#13 81.97 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.15.0>
#13 81.97 npm notice Run `npm install -g npm@8.15.0` to update!
#13 81.97 npm notice
#13 81.97 npm ERR! code 128
#13 81.98 npm ERR! An unknown git error occurred
#13 81.98 npm ERR! command git --no-replace-objects ls-remote ssh://git@bitbucket.org/houseofdevtech/verscan-protobuf.git
#13 81.98 npm ERR! Warning: Permanently added 'bitbucket.org' (RSA) to the list of known hosts.
#13 81.98 npm ERR! git@bitbucket.org: Permission denied (publickey).
#13 81.98 npm ERR! fatal: Could not read from remote repository.
#13 81.98 npm ERR!
#13 81.98 npm ERR! Please make sure you have the correct access rights
#13 81.98 npm ERR! and the repository exists.
#13 81.99
#13 81.99 npm ERR! A complete log of this run can be found in:
#13 81.99 npm ERR! /home/node/.npm/_logs/2022-07-22T10_18_37_431Z-debug-0.log
------
executor failed running [/bin/sh -c npm ci]: exit code: 128

What should I do?

2 answers

1 accepted

0 votes
Answer accepted

The problem occurred because I use another user which isn't the root user in the Dockerfile, and that screwed up the ssh thing. 

To solve this problem, add uid=<user id of the user> to the --mount=type=ssh command

RUN --mount=type=ssh,uid=<user id> npm ci
0 votes

Hello @Siriwudhi Sawaidee ,

Welcome to Atlassian Community!

The error message printed in the logs indicates the SSH key you are using to authenticate the git clone command does not have permissions to clone the repository : 

#13 81.98 npm ERR! git@bitbucket.org: Permission denied (publickey).

In this case, could you please confirm :

  • Are you running this docker build locally or in Bitbucket pipelines? If in Bitbucket pipelines, I would suggest taking a look at the blog post Cloning another Bitbucket Repository in bitbucket pipelines 
  • Are you copying the private SSH key to your docker image in any of the previous steps of your docker file? If not, you will have to COPY the private SSH  to the path ~/.ssh/id_rsa inside your docker image so it will be used by git
    COPY <path to local ssh key>/my_key ~/.ssh/id_rsa
  • The public ssh key you are using needs to added in a bitbucket account that has access to the repository being cloned or added as an access key in that repository

If after following the suggestions above you are still facing the same error, please share the Dockerfile with us so we can help you investigate further.

Thank you, @Siriwudhi Sawaidee .

Kind regards,

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events