-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build context in private gitlab repository #719
Comments
kaniko/pkg/buildcontext/git.go Line 37 in 32b3b4f
kaniko/pkg/buildcontext/git.go Line 44 in 32b3b4f
I don't think so |
@bitsofinfo, @SamyCoenen is correct. there is no way as of now. |
Does this affect cloning from private azure devops repos? Edit: If someone could point me in the right direction, I will take a stab at solving it. take |
If I understand everything correctly it seems to be related to
|
Looks like support for private repositories has been recently added through setting the Seems like there's probably a bit of room to document it more clearly in the README - I'll create a PR. |
same problem in private gitlab. but i can use kaniko in private github. ` containers:
but i got this err: any help? |
thanks for you apply. the readme shows that the private git repository can either use git://token@xxx or use env GIT_TOKEN,the two methods both give me the err: authentication required |
facing same issues !! Any thing working process ?? |
I'm also facing a problem against context in private azure devops repo. |
Also would like to use kaniko with internal private GitLab. |
me too ... |
Works for me in argo workflow template to fetch private Gitlab repo Pass only this one env
and keep context in this format
|
this solution works for |
I also need this functionality. |
Seems to work fine on latest kaniko 1.8.1 with |
The doco https://github.com/GoogleContainerTools/kaniko/blob/main/README.md#using-private-git-repository states "You can use Personal Access Tokens for Build Contexts from Private Repositories from GitHub." ...does that mean only GitHub and nothing else? We have been attempting to use kaniko and git context but from a private Azure Devops git repo but get error http/400 (bad request) for /git-upload-pack -> https://git-scm.com/docs/git-upload-pack
UPDATE: tested same but using a private github repo and GIT_TOKEN variable and it works
UPDATE: microsoft acknowledge the issue but wont be changing things at their end confirmed here fluxcd/source-controller#104 (comment) and in microsoft ticket 22962210190030002812 WORKAROUND 02/11/22: similar solution to @twDuke we ended using an init container in the kubernetes deployment to run before kaniko container and to git clone the azure devops repo to deployment volume visible to both |
@mattduguid How did you manage to git-clone the Azure DevOps repo using initContainers ? I'm interested 👍 Because we're in a situation, due to technical constraints, where we want to deploy a Kaniko Pod from Azure Pipeline CI (using a Self Hosted agent running inside a Pod Kubernetes) and we're not unable to use the "context" locally :( What I tried (but it seems it's a dead end):
The goal of this approach in the end is to try to let kaniko build our image without pushing it somewhere if possible (so we can use the produced image in .tar format in whatever way we please - scan the image for example) Doesn't work :( I don't know if it's "normal" it can't work or it could but I may be doing something wrong? |
@skype007 used the following, the syntax is HCL from our terraform resource "kubernetes_manifest" for a manifest kind of "deployment",
Not the most ideal solution but it has unblocked us for now. Hope that helps 👍 |
@mattduguid Thank you for your sample ;) Only the "git clone" didn' work for me as it still asked me about Username/Password even if I passed the PAT token. So in my pipeline I managed to make it work using this (in initContainers):
Like you said, better than nothing ! Hope it can help someone facing the same issue ! |
As far as I can tell, it does work with the latest kaniko debug executor releases. However, in my case the problem turned out to be with the GitLab side. When creating your project access token, you need to give it developer access; guest access isn't enough. This is horribly confusing since you can give it read_repository permissions but without a higher role, it still won't be able to clone. I set the following env vars in my pipeline:
|
@ianthetechie This is really helpful. For "though per the docs, I think any non-blank username works", which docs are you referring to? Thanks! |
I'm also facing a problem against context in private gitlab repo using GIT_TOKEN. It works fine on latest kaniko with GIT_USERNAME and GIT_PASSWORD env vars。 |
Seems like it doesn't support gitlab |
is there anyway to pull build context from a private gitlab repo?
The text was updated successfully, but these errors were encountered: