question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building in docker container failing / extremely slow

See original GitHub issue

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 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:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
genoxcommented, 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!

0reactions
ilteooodcommented, Nov 29, 2018

+1 for the suggestion of @genox

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why docker build is so slow - Stack Overflow
I tried to build same image at my ubuntu inside virtual machine with same docker version and it builds it in 5 seconds,...
Read more >
Docker extremely slow, on linux and windows
Hi guys, I was working with Docker on a Win11 machine and the application run very very slow, around 30 seconds or even...
Read more >
Veeery long building time inside Docker container - help
Hello, I'm opening the new discussion thread to collect all information about Meteor building duration problem on one place.
Read more >
Six Ways to Build Docker Images Faster (Even in Seconds)
Building Docker images is the longest process on this list. For example, it took 14 minutes to build each non-optimized backend image.
Read more >
Slow performance on M1 Macbooks leads to supporting multi ...
Already know you are seeing cross-architecture problems? ... Lucky for us, both Docker Desktop and KinD support M1 so we were able to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found