sionsmith
- Build your java / maven projects as normal.
- Use the maven scm / release plugin to publish your artifacts to your internal maven repo (Nexus) we use.
- In your Dockerfile use wget and the Nexus REST api to pull the jar / zip whatever from the Maven repo. (https://maven.java.net/nexus-core-documentation-plugin/core/...)
- Install Docker publish image plugin for Jenkins (https://github.com/jenkinsci/docker-build-publish-plugin/blo...)
- Create a downstream project based on your java / build.
Once all that is set up, every time you do a push / check in a the Docker image in your registry should be update.
Thanks for the updated post. Could you give us a little more information / git gist ;) on how you achieved this: > Docker registry doesn’t inherently support the concept of versioning, so we have to manually add it using the Jenkins version numbers. > shell scripting to ensure that only 3 were kept in place on each deployment,
Did this involve you appending the version numbers to the image tag? We have a pretty similar set up, and something which you might want to look at is the registry being a SPOF, if that is down then none of the new nodes created by the ELB can be provisioned - create an AWS autoscale group of 1 and assign it an elastic IP to ensure if it goes down the kind bots at Amazon will bring another up for you. (Will require some cloud-init scripting)