Building in docker container failing / extremely slow
See original GitHub issueHi,
I’m trying to build an app with typescript in a docker container (for CI/CD) but the build (using webpack, babel, as per NextJS) never finishes and eventually exits when it hits timeout.
When I build the app (with prod env) locally, not inside the container, the build works fine and finishes after 15s. In a docker container (tried alpine and ubuntu), it hangs at 100% CPU, slowly filling memory, with low I/O.
I’m using NextJS with @zeit/next-typescript
- already asked for guidance over there but to no avail.
I’m using webpack@3.11.0, ts-loader@3.5.0 and typescript@latest. Unfortunately I can’t just upgrade to webpack 4 for the new ts-loader versions for testing - locked in by NextJS. I tried with various typescript versions, the only difference is that some of them leak memory more than others. 😉 But the result stays the same.
Anyone ever experience a similar issue, especially within a docker container?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
I figured it out eventually.
For some (
¯\_(ツ)_/¯
) reason, builds that are being run in the root of a docker image hang. Moved everything into a subdirectory and it magically works. Somewhere (anywhere from webpack through babel including tsc) a file glob pattern is not expecting to be run in the root directory … or so. But I don’t feel like digging deeper on that end, either.Thanks for the great work you do on this library and all the best!
+1 for the suggestion of @genox