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

[BUG] Docker build process OOM #442

Open
timkunze opened this issue Jun 9, 2023 · 1 comment
Open

[BUG] Docker build process OOM #442

timkunze opened this issue Jun 9, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@timkunze
Copy link

timkunze commented Jun 9, 2023

Which tool is impacted?
The Docker build process for the entire project

To Reproduce
Steps to reproduce the behavior:

  1. Check out the repository
  2. Execute 'docker build -t it-tools .'
  3. See the error in the terminal

Expected behavior
The project should successfully build via Docker without encountering exceptions or errors.

Screenshots
Please see the attached logs for the terminal output when the error occurs.

Configuration (please complete the following information):

  • Device: Raspberry Pi 8 GB
  • OS: Raspbian GNU/Linux 11 (bullseye)
  • Docker Version: Docker version 24.0.0, build 98fdcd7

Additional context
I encountered an "Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory" error in the Docker build process. The error occurs at "RUN pnpm build" in the Dockerfile on a device with 8 GB memory available, huh.

Terminal Output

[build-stage 6/6] RUN pnpm build:
#0 2.111
#0 2.111 > it-tools@2023.5.14-77f2efc build /app
#0 2.111 > vue-tsc --noEmit && vite build
#0 2.111
#0 9.932 Duplicated imports "toRef", the one from "vue" has been ignored
#0 11.18 [unplugin-vue-components] component "GitMemo"(/app/src/tools/git-memo/git-memo.vue) has naming conflicts with other components, ignored.
#0 11.21 vite v2.9.15 building for production...
#0 11.46 transforming...
#0 136.7 Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
#0 136.7 Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
#0 159.9 ✓ 16994 modules transformed.
#0 189.5 rendering chunks...
#0 199.2
#0 199.2 <--- Last few GCs --->
#0 199.2
#0 199.2 [17:0xf4bab090] 184408 ms: Scavenge 986.5 (1039.1) -> 978.8 (1039.1) MB, 3.3 / 0.0 ms (average mu = 0.228, current mu = 0.052) allocation failure;
#0 199.2 [17:0xf4bab090] 188405 ms: Mark-sweep 988.0 (1041.0) -> 970.5 (1038.3) MB, 3557.0 / 0.3 ms (average mu = 0.257, current mu = 0.277) task; scavenge might not succeed
#0 199.2 [17:0xf4bab090] 191466 ms: Mark-sweep 984.2 (1043.4) -> 972.8 (1036.3) MB, 2823.6 / 0.0 ms (average mu = 0.181, current mu = 0.078) allocation failure; scavenge might not succeed
#0 199.2
#0 199.2
#0 199.2 <--- JS stacktrace --->
#0 199.2
#0 199.2 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
#0 233.6  ELIFECYCLE  Command failed.
Dockerfile:7
5 | RUN npm install -g pnpm
6 | RUN pnpm i --frozen-lockfile
7 | >>> RUN pnpm build
8 |
9 | # production stage
ERROR: failed to solve: process "/bin/sh -c pnpm build" did not complete successfully: exit code: 1

@timkunze timkunze added the bug Something isn't working label Jun 9, 2023
@bgh-github
Copy link

I had a similar problem doing (non-Docker) builds. What helped in that case, on build VM with 2 GB memory, was setting what seemed to be a happy medium value for the following Node option - export NODE_OPTIONS=--max-old-space-size=1792

Related issue vitejs/vite#2433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
3 participants