Foreman Dockerfile proposal: publish base and builder-base images


As I started playing with the Dockerfile available in the Foreman repository, I’ve started to feel the pain of re-downloading the devel dependencies every time I was builds when rebuilding the image.

Therefore, I started playing with extracting the base images into separate layers that can be re-used and there is a PR that implements it. You can see more technical details there, but to wrap up the goals for this change, it’s:

  • have a faster image build time (to avoid installing ruby/node/python all the time)
  • have a image that can be used for development
  • speed up plugin image build time by reusing a foreman published build image
  • the speed-up can be leveraged both at the devel machines, as well as in CI (if rebuilding the images for specific plugin would be needed before running the tests).

As a downside, we would have additional images we need to take care of in terms of regular rebuilding.

So two questions I’m raising are:

  1. do others see the benefits of this change to get that in?
  2. in what frequency this images should be re-build?

Some more technical details from the PR:

The core of the proposal is having intermediate images involved in the build:

The basic layout looks like this:

├─ Dockerfile.builder-base[]
│  │
│  └─ Dockerfile[builder]
│     ¦
│     ¦ # artifacts copied over
│     v
└─ Dockerfile