What if I need to build a Docker image when I use ACI as my Jenkins build agent?

If I run Docker Build on AKS, is it secured?

Earlier this year, the Azure Container Registry team released a preview of a native container build capability called Azure Container Registry (ACR) Build, which solves just these problems. One of the best things about ACR build is you only pay for the compute you use to build your images.

Build from local directory

Let’s say you have an existing pipeline that uses Maven to build your Java project and then deploys to AKS:

The benefits

Best yet, you no longer need to get into another debate with your peers about whether it is safe to run Docker on Docker.

Build based on git commits

What if you are setting up a new pipeline and just want to trigger build upon code commit? Fear not, ACR Build supports commit based builds. We set up a sample Jenkins file that allows you to build a Spring Boot Web App in ACR with deployment to AKS. In this case, once code is committed to GitHub, Jenkins will trigger the build in ACR, you can run tests (not covered in sample) and then deploy the Docker image to production. Simply follow the instructions on building a Docker image from git repo in ACR then deploying to AKS using Jenkins.

We will preview Azure ACR plugin at Jenkins World 2018. We will also have a few demos showing how to deploy to App Service with Tomcat and Java SE.

Please drop by the Azure Jenkins booth, see a demo, or chat with us about how you are integrating Jenkins with Azure. We are always looking for feedback and to hear more about your build systems.