Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Packaging] Optimize image size of govtool/backend #954

Open
mesudip opened this issue May 8, 2024 · 0 comments
Open

[Packaging] Optimize image size of govtool/backend #954

mesudip opened this issue May 8, 2024 · 0 comments

Comments

@mesudip
Copy link
Contributor

mesudip commented May 8, 2024

The current docker image size is of 5.39GB which is very large for a simple service, compared to cardano-node or db-sync.

Image size reported for different docker images

REPOSITORY                                         TAG       IMAGE ID       CREATED         SIZE
govtool/backend                                    latest    b6413eb58785   17 hours ago    5.39GB
govtool/backend-base                               latest    3a852d2c9dc2   22 hours ago    5.21GB
ghcr.io/intersectmbo/cardano-node                  <none>    ddba06d70271   7 months ago    911MB
ghcr.io/intersectmbo/cardano-node                  <none>    aef9e1df664f   7 months ago    928MB

Suggestions

  • Separate out docker image for build and runtime with multi-stage docker file.
  • Exclude ghc in the final image. ghc build system is very large (~2Gb) this is not required at runtime.
  • Exclude cabal store and packages in final image.
  • Exclude dev libraries in final image e.g libpng-dev libpq-dev libreadline-dev libpsql-dev etc. These are only required for building backend with ghc and not during the runtime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant