Skip to content

Dockerfile: use multi-stage build optimisation#1659

Merged
kamuikatsurgi merged 5 commits intodevelopfrom
kamui/docker-optimisation
Jul 24, 2025
Merged

Dockerfile: use multi-stage build optimisation#1659
kamuikatsurgi merged 5 commits intodevelopfrom
kamui/docker-optimisation

Conversation

@kamuikatsurgi
Copy link
Copy Markdown
Member

Description

Switched to pinned Go 1.24 & Alpine 3.22; used a two‑stage BuildKit build with cache+SSH mounts to compile, then copied only the bor binary into a tiny Alpine runtime (just certs, no toolchain or Bash)—slashing the image from gigabytes to a few hundred megabytes.

This mirrors exactly what Geth’s Dockerfile does; see their approach here:
https://github.com/ethereum/go-ethereum/blob/master/Dockerfile

Copy link
Copy Markdown
Contributor

@lucca30 lucca30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@kamuikatsurgi kamuikatsurgi merged commit 5cdef9b into develop Jul 24, 2025
9 of 10 checks passed
@kamuikatsurgi kamuikatsurgi deleted the kamui/docker-optimisation branch July 24, 2025 12:11
nebojsa94 pushed a commit to nebojsa94/bor that referenced this pull request Aug 14, 2025
* feat: use multi-stage build in Dockerfile

* chore: nits

* chore: remove comments

* chore: add bash in runtime image

* chore: use alpine latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants