Skip to content

pre-commit docker image is tooooooo large #693

@samzong

Description

@samzong

The current Dockerfile.precommit produces a very large image. It includes full Go, Python, Node.js and Rust toolchains, plus various lint tools. This works functionally, but the image size makes CI pulls slower and increases overall maintenance cost.

It may be worth considering a lighter approach, for example:

  • Use a slimmer base image.
  • Use multi-stage builds and only copy the final tooling binaries.
  • Install only the runtimes actually needed for the pre-commit hooks.
  • Use released binaries (e.g., golangci-lint) instead of installing full toolchains.

These changes could keep the same functionality while significantly reducing image size.

@Xunzhuo @rootfs if possible, I would like to optimize it. 😫

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions