Monday, June 1, 2015

Pushing Docker containers to more than one registry using Gradle

In the early days, we had to maintain two docker registries, one in AWS us-east-1 and the other in eu-west-1. This required us to build our containers and then push it to both registries. Below is a build.grade using Ben’s Gradle-Docker plugin to do the following:
  1. Builds a docker container based on the Dockerfile in the root directory.
  2. Tag and push to both repos (us-east-1 and eu-west-1).
The root directory (project folder) should contain your Dockerfile and build.gradle.

This is how the build.grade looks like:


Note that you can also build this on Jenkins.

No comments:

Post a Comment