Next.js Discord

Discord Forum

Premature build exit

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
I am trying to dockerize my nextJS app, when I try to do next build from my Dockerfile it does work on my local machine but fails in the pipelines. What is weird is that in both cases build command exits with code 0. But on local machine build takes upto 1 minute and produces all output files ("output": "standalone") and Compilation messages. But in pipeline, build command shows
$ next build
  ▲ Next.js 14.2.18
   Creating an optimized production build ...
Done in 5.53s.


doesn't have any errors and doesn't create the output files or show any messages and the exit code is also 0.

Any suggestion on how to approach this?

Next.js v14.2.18
Node v20

Difference in systems:
* Docker version has mismatch, on systems it work docker --version is Docker version 27.2.0, build 3ab4256 and on system where it doesn't it is Docker version 20.10.24, build 297e128.
* System memory is different on systems where it worked had 16GiB RAM and on pipeline where it didn't it had 4GiB.

These are the only differences I could notice. Why does the build prematurely exit and not produce any log or output without even an error code on the pipeline server? Any pointers would be helpful.

0 Replies