Skip to content

Building in docker container failing / extremely slow #758

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

Closed
genox opened this issue Apr 8, 2018 · 10 comments
Closed

Building in docker container failing / extremely slow #758

genox opened this issue Apr 8, 2018 · 10 comments

Comments

@genox
Copy link

genox commented Apr 8, 2018

Hi,

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 [email protected], [email protected] 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?

@johnnyreilly
Copy link
Member

As far as I can tell, this is not a ts-loader issue and so I'm closing this issue. I hope you get your issue sorted. Please feel free to re-open if you identify a specific ts-loader problem

@genox
Copy link
Author

genox commented Apr 9, 2018 via email

@johnnyreilly
Copy link
Member

You could up the log level to info: https://github.com/TypeStrong/ts-loader/blob/master/README.md#loglevel-string-defaultwarn

There's also a trace option you could try including

@genox
Copy link
Author

genox commented Apr 9, 2018

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!

@johnnyreilly
Copy link
Member

Thanks for reporting back! It's always good to know where things get to 😄

@chris-vest
Copy link

@genox Thanks for the fix on that, was having the same problem!

@wchatx
Copy link

wchatx commented Sep 12, 2018

@genox same problem and your fix solved it. thanks!

@MikeShiner
Copy link

@genox same problem here - thank you! You've saved me a lot of time with this niche issue.

@OrenSchwartz
Copy link

OrenSchwartz commented Nov 24, 2018

+1 for the fix suggested by @genox

@ilteoood
Copy link

+1 for the suggestion of @genox

valadaptive added a commit to valadaptive/twithook that referenced this issue Aug 16, 2022
Okay, so this works locally but fails in docker-compose on my VPS.
Trying TypeStrong/ts-loader#758 (comment)
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

No branches or pull requests

7 participants