News for hackers. Stuff that matters.
Re:Docker for Mac M1 RC by tshaddox on Friday March 19, 2021 @02:18PM (#26516673)
Yep, using Webpack in Docker on a Mac is essentially unusable. I see around a 5-10x slowdown in Webpack builds. Using docker-sync seems to help the CPU out a bit, so my MacBook Pro doesn't do the jet engine space heater routine quite as much, but the performance is still nearly unusable.

https://docker-sync.readthedocs.io/en/latest/

Re:Docker for Mac M1 RC by aguilarm on Friday March 19, 2021 @02:39PM (#26516904)
webpack can be made use-able relatively easily if you do not mount node modules over the shared file system. I've been doing this for quite awhile with a volumes declaration in docker-compose that looks like this (running nextjs, assuming /usr/src/app is where your dockerfile has your node stuff):

(on service definition): volumes: - .:/usr/src/app:cached - node_modules:/usr/src/app/node_modules/ - next_artifacts:/usr/src/app/.next/

and then in the top level volumes key defining node_modules and next_artifacts as blank/default.

That means I mount everything except node modules and the build artifacts so the shared filesystem does a LOT less work trying to sync stuff. The downside, of course, is that I need to run npm commands both inside the container and outside if i want them in my IDE. A fair trade for decent performance. That setup is still not as fast as native but definitely usable and does not send my machine into space header mode much more than normal usage.

Re:Docker for Mac M1 RC by tshaddox on Friday March 19, 2021 @02:47PM (#26516984)
Interesting. I have always had the same docker-compose setup with a separate node_modules volume inside Docker, but I've always still had the jet engine space heater issue.
Re:Docker for Mac M1 RC by bdcravens on Friday March 19, 2021 @04:41PM (#26517964)
I've been able to improve performance in docker-sync by adding high-churn folders that I don't care about to sync_excludes