Skip to content

fix: Docker build improvements β€” disable debug symbols, add ccache, add .dockerignore - #725

Open
dyiapanis wants to merge 1 commit into
daijro:mainfrom
dyiapanis:fix/docker-build-issues
Open

fix: Docker build improvements β€” disable debug symbols, add ccache, add .dockerignore#725
dyiapanis wants to merge 1 commit into
daijro:mainfrom
dyiapanis:fix/docker-build-issues

Conversation

@dyiapanis

Copy link
Copy Markdown
Contributor

Related Issue

Closes #698

Description

Three Docker build fixes:

  1. Add --disable-debug-symbols to assets/linux.mozconfig β€” Distribution builds don't ship symbols anyway. Debug info inflates memory usage at the link stage, causing OOM kills on arm64 builds (the gkrust fat-LTO staticlib + libxul link peaks past available RAM). This keeps the link under the RAM ceiling and shrinks the binary.

  2. Add ccache to Dockerfile apt-get install β€” assets/base.mozconfig already has a conditional if command -v ccache check, but the Dockerfile never installs ccache, so every Docker build runs cold. Adding ccache to the package list makes the conditional actually trigger, enabling incremental build caching.

  3. Add .dockerignore β€” Without it, COPY . /app ships .git, dist/, node_modules/, and built artifacts into the build context. This trims the context substantially and prevents patch.py's git clean -fdx from walking up to the host git work tree created by COPY . /app.

Type of Change

  • Bug fix

Testing

  • arm64 build completes without OOM (previously SIGKILLed at link stage)
  • Subsequent Docker builds use ccache (cold build ~40min, warm ~5min)
  • Build context reduced from >500MB to <50MB

Checklist

  • I have linked a related issue above
  • My changes are focused on a single logical change
  • I have added testing instructions which include the desired result

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.

Docker linux/arm64 build OOM-killed during link (+ missing ccache, no .dockerignore)

1 participant