Azure-docs: How to build images when code repo is private

Created on 2 May 2018  Â·  7Comments  Â·  Source: MicrosoftDocs/azure-docs

Hi Team,
This is great tutorial with all detailed instructions. Thank you! However, my scenario is, I am using private bitbucket stash server onprem. so, in this case, my guess is (need to try it out by replacing github.com), git clone step will fail. So, I would appreciate any guidance around this scenario.
Thanks once again!


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

container-registrsvc cxp in-progress product-question triaged

All 7 comments

@lalitkale Thanks for the question! We are investigating and will update you shortly.

@lalitkale I believe you would need to fork the repro to a non private repro in order to follow the steps in this specific document.

Else, I found this article on pulling from a private repo which might help:

https://stackoverflow.com/questions/20485891/git-how-to-log-in-and-pull-a-private-repo

@MicahMcKittrick-MSFT Thank you for the hint. let me try this and get back to you. As I understand from above answer is, for all my organizational private repositories (which endup being containers) to take advantage of ACR build, I have clone them. This is slightly uncomfortable though for reasons e.g. storage billing, build times etc. Any suggestions?

You should be able to simply use your private repos rather than having to fork them to public. This is how we work with the Azure Docs as well. However of course they just have it setup right so it works for me :)

Try following the SO link above or also this one:
https://stackoverflow.com/questions/12237790/github-fork-a-private-repo

And let me know if you hit issues.

Hi @lalitkale,

I would like to get a bit more clarification from you about your use case. Are you saying that you don't want to fork the repository? Or that you don't want to clone it? I'm not 100% clear on your issue.

ACR Build doesn't actually care how you get your code onto the machine that's executing the az acr build command, or where the Dockerfile and its associated files come from. All it really needs is a valid Docker file, and the associated application files, if any. You don't necessarily have to fork and clone a repo to use az acr build.

If you have an on-prem machine that that has your image source code (Dockerfile + application files), whether that's from a private Bitbucket repo or another SCM, as long as you have the Azure CLI installed, you can use ACR Build to build the image.

Now, if you're referring to automated builds on code commit, then yes, that is currently restricted to GitHub repositories in the ACR Build preview.

Please let me know if you have further questions, or provide additional clarification on your use case.

Thanks for using ACR Build!

Hi @mmacy
My ultimate goal is to make ACR Build as part of my CI-CD workflow. You have already answered that with

Now, if you're referring to automated builds on code commit, then yes, that is currently restricted to GitHub repositories in the ACR Build preview.

However, Your explanation in above comment

If you have an on-prem machine that that has your image source code (Dockerfile + application files), whether that's from a private Bitbucket repo or another SCM, as long as you have the Azure CLI installed, you can use ACR Build to build the image.

definitely helped my poor understanding about az acr build. Now, I fully understand that to fire up 'az acr build' I don't need to clone the repo. This is greatly helpful. I think even @MicahMcKittrick-MSFT tried to explain me the same, however, I was not able to get that in first go. I wish to see acr build goes further and consider CI-CD scenarios so that we can push the container images directly to acr.

Thanks to all good folks in acr team!

Appreciate your help @MicahMcKittrick-MSFT and @mmacy for understanding this issue.

@MicahMcKittrick-MSFT @mmacy I think, we can close this issue now. Thanks again!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spottedmahn picture spottedmahn  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

Ponant picture Ponant  Â·  3Comments