Shared library to build docker images

I’m very excited about this shared library. I actually submitted it to be used in jenkins-infra (which has been heavily upgraded and made even cooler). This version will build and publish an image every time master (configurable) is updated. When code is tagged, it’ll also upload a specific version of that tag. I use it for a lot of the docker images I use in helm charts.

jenkins-shared-library/buildDockerfile.groovy at 7e0ee95ee11c9fb9781cf872f650f1dadb2cce5d · halkeye/jenkins-shared-library · GitHub

1 Like

As you mentioned, that shared library as been made even better with the help of @dduportal and Garet by adding few abstraction.

  1. Instead of calling docker command, Damien switch to a Makefile so we can run exactly the same commands locally.
  2. By templating docker commands, we can easily switch between docker and img, which is useful when either building images from k8s environment or virtual machine with docker installed
  3. Using semantic versionning for docker tag
  4. Using container structure test
    Link

Nice work @halkeye ! It looks like the initial work differed a bit between your library and the current one used on infra.ci (pipeline-library/buildDockerAndPublishImage.groovy at 49079e12057df69a0a73e9551ba56deac0e5e4fa · jenkins-infra/pipeline-library · GitHub) but the concept stays the same!

That is really nice to see such use cases!

Don’t hesitate to share what you learned by building this library and contribute back to the existing one if you feel it!

I’m also available to discuss and challenge any choice we made on the current one of course