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.
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.
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.