The resulting image is very large (~ 1GB) because it still contains the C compilers and build tools. After building you should copy the build artefacts to a new image (multi-stage build) which will drop all the build tools and bring the size down considerably (probably to < 250 MB).
The resulting image is very large (~ 1GB) because it still contains the C compilers and build tools. After building you should copy the build artefacts to a new image (multi-stage build) which will drop all the build tools and bring the size down considerably (probably to < 250 MB).
There are additional tricks, like cleaning the apt package cache, but a basic multi-stage should give the largest improvement. See e.g. https://github.com/wtsi-npg/npg-irods-python/blob/devel/Dockerfile