Azure Container Registry Tasks Plugin
This plugin allows to queue an Azure Container Registry Quick Task.
Go to your Jenkins master, click 'Manage Jenkins' -> 'Manage Plugins' -> 'Available', then search
Azure Container Registry Tasks Plugin and install the plugin.
This plugin requires your Azure Credential to auth your operation. You can refer Azure Credential Plugin to find what kind of autherization methods are supported.
Creating a freestyle job
Go to your Jenkins job configure page. Tap "Add build step", add "Queue an ACR Quick Task". You will see the configuration.
Select your Azure credential ID which you already saved to your Jenkins server.
Select your Resource group which contains your Azure Container Registry.
Select your Azure Container Registry name, which will be used to build and host your docker image.
Source code location, you can choose
remote tarballas your docker build path as
docker build [PATH | URL | -].
Git- If you want to directly build a docker image from a git repo, choose
Gittype and enter the repository Url.
The Url should use HTTP(S) protocol instead of SSH protocol. If your git repo is a private one, add the PAT in the URL, e.g. https://<github_token>@github.com/user/repo.git.
You can use
Refspecto specify a branch with branch name or a pull request in format
pull/<pr number>/head. Leave this field empty means the Azure Container Registry will build with default branch.
Docker build pathhelps you set the docker build path. If you want to build your docker image under a sub-directory, add the relative path to the git repo's root path. Leave this field empty means the Azure Container Registry will build in the git repo's root path.
Local directory- If you want to build a docker image with a local directory on your Jenkins server, choose
Local directoryand input the path. This plugin will upload the directory to an Azure Storage Blob and send the URL to Azure Container Registry.
Remote tarball- If you have already host your code as a
tar.gzfile on a web server, choose
Remote tarballand send the url directly to Azure Container Registry.
This plugin uses
Local directorywith value
.as default. It will upload the code got from
Source Code Managementand processed by previous steps to Azure Storage Blob.
After Azure Container Registry finishes docker build, it will execute docker push to push images to your registry. You need to specify the image name and optionally a tag under
Image name with taglist as
docker build -t [name:tag] PATH | URL | -. Leave this list empty, nothing will be pushed to your registry after docker build.
Dockerfile pathto specify the relative path of Dockerfile as
docker build -f [Dockerfile] PATH | URL | -. Default is
<local directory path/git repo/remote tarball>/Dockerfile.
Set docker build-time variables in
Docker build argumentslist as
docker build --build-arg [list] PATH | URL | -
docker build --no-cache PATH | URL | -flag by checking the
Docker build no cache.
You can specify the timeout option for your Azure Container Registry Build with
Docker build timeout in seconds.
You can choose your docker build agent platform from
Docker build platform.
This plugin also supports Pipeline project. You can use
Pipeline Syntax to generate pipeline script.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.