Due to how we build our Docker images, we need to install some development packages during the build of the base images we use for our final builds. However, we don't actually need those packages at runtime, and we don't remove them after we've installed the things that need to be built against them.
Currently, the primary culprits are:
python3-dev
gcc
musl-dev
mariadb-dev
postgresql-dev
mongo-c-connector-dev
Of these, the first three can be completely removed after the pip install
command we run to pull in specific python dependencies. The other three can be mostly removed, but will need the runtime libraries that were linked against to be installed. I'm fairly certain that the relevant packages are, respectively, mariadb-connector-c
, postgresql-bdr-libs
, and mongo-c-connector
.
All of this, including the pip install
command, needs to be handled as a single RUN
command in base/Dockerfile
.
This issue was prompted by @ilyam8 noticing a significant increase in our Docker image sizes (over 350MB) that I'm 99% certain is a result of us now pulling in mongo-c-connector-dev
.
@prologic If you want to deal with this yourself that's fine, if not I'll deal with it when i get back from vacation.