Use a [multi-stage build](https://docs.docker.com/v17.09/engine/userguide/eng-image/multistage-build/) to avoid letting build tools (g++, git, wget, pip…) and build artifacts in the resulting image. It should significantly reduce the image size.