git private repo authentication problem Kaniko (OD-1892)
Closed
vipul opened 2 weeks ago

Hello Robin,

We are facing the git private repo authentication problem when Kaniko has to do authention written under dockerfile.

e.g Dockerfile performing git clone .

Basically, it looks like that we need to implement solution like this https://medium.com/hiredscore-engineering/kaniko-builds-with-private-repository-634d5e7fa4a5

Even though we put hardcoded token like this git clone http://username:(users;s Access TOKEN)@serverIP or host:6610/repo.git, it returns you don't have permission to clone this repo even though the user has full owner rights.

Do you have any working set of steps for fixing it for Kaniko executors? Our Docker and shell executors are working perfectly for this auth.

Robin Shen referenced from other issue 1 week ago
Robin Shen commented 1 week ago

An example Dockerfile:

FROM alpine/git
RUN git -c http.extraHeader="Authorization: Bearer xhkYbED6AlaYUgoi9GJMOIGErBut9ajAJ3uGUr8v" clone http://192.168.71.30:6610/test

Here xhkYbED6AlaYUgoi9GJMOIGErBut9ajAJ3uGUr8v is an example access token with permission to clone the test repository

If you do not want to put this access token in git repository, just use a placeholder here, and add a command step before Kaniko step to replace the placeholder in Dockerfile with a build secret containing the access token.

Robin Shen changed state to 'Closed' 6 days ago
Previous Value Current Value
Open
Closed
issue 1 of 1
Type
Question
Priority
Major
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-1892
Please wait...
Page is in error, reload to recover