Make it easier to build Docker images locally
Currently, the logic of building our docker image requires the package to be available over internet to be downloaded during docker build
. This makes sense in CI, but makes life of contributors who want to build Docker image locally less smooth. We should support using a local package file instead.
History: This was the original case when this was first implemented, but was switched to getting it from Internet because it increased the docker images size. This is because the package needs to be ADD
ed in one layer while it was being used and could be removed only in another layer.
This also has the problem of us using two paths for building Docker images depending on where it is happening - if on dev, we use the S3 bucket while if on omnibus-gitlab-mirror, we use CI artifacts. This resulted in #2470 being opened.
Possible solution? Implement multi-stage builds for our Docker image. This way, we can add the package in one layer, use it and remove it in another, and not make the docker image humongous.