During CI, we publish an image to the GitHub Container Registry (GHCR) - https://github.com/guardian/dotcom-rendering/pkgs/container/dotcom-rendering.
If we pull the image and look at its size, we can see it is ~500MB compressed, and ~2GB uncompressed:
❯ docker pull ghcr.io/guardian/dotcom-rendering:main && docker image ls ghcr.io/guardian/dotcom-rendering:main
main: Pulling from guardian/dotcom-rendering
Digest: sha256:3c920ffc43e515aadba79ed9ff1017ebb8ddf0fd8583dbc77e34ef70e0862f0f
Status: Image is up to date for ghcr.io/guardian/dotcom-rendering:main
ghcr.io/guardian/dotcom-rendering:main
What's next:
View a summary of image vulnerabilities and recommendations → docker scout quickview ghcr.io/guardian/dotcom-rendering:main
i Info → U In Use
IMAGE ID DISK USAGE CONTENT SIZE EXTRA
ghcr.io/guardian/dotcom-rendering:main 3c920ffc43e5 2.12GB 511MB
This feels quite big for a Node application?!1
Could we make the image smaller? It's worth noting that the image is only used in the context of CI, but it being smaller might decrease build times. If this were a private repository, a smaller image would reduce costs too.
During CI, we publish an image to the GitHub Container Registry (GHCR) - https://github.com/guardian/dotcom-rendering/pkgs/container/dotcom-rendering.
If we pull the image and look at its size, we can see it is ~500MB compressed, and ~2GB uncompressed:
This feels quite big for a Node application?!1
Could we make the image smaller? It's worth noting that the image is only used in the context of CI, but it being smaller might decrease build times. If this were a private repository, a smaller image would reduce costs too.
Footnotes
For comparison, https://github.com/guardian/cdk-playground also produces a Docker image (published to AWS ECR) and is ~200MB compressed and ~580MB uncompressed. ↩