Hacker News new | ask | show | jobs
by ghc 1207 days ago
I know from extensive debugging of this issue that docker is the problem. You basically can't run docker (as of 6 months ago...I hope this will eventually be false) on an M1/M2 without causing significant heating and battery drain. Since this is the fault of the OS, maybe Asahi will eventually be the solution.
3 comments

Yes, same conclusion.

I wonder if people using it for writing code are running docker at all, you read so many comments on HN of how the battery life is incredible (on any thread about comparisons between any Mac and any other laptop) while in my experience a full charge Macbook Air M2 lasts about 6 hours with Docker running instead of the usual 15 it lasts when its off.

I write code full time. I run Docker as little as possible, preferring to run everything “natively”. It’s so much simpler than figuring out how to get whatever shitty webstack working with reloading etc. It’s faster. Battery life is better. There’s no downside in my experience as macOS is a good enough *nix that almost everything Just Works™.

The only time I run Docker is to test an image locally, which is in general only to debug my Dockerfile.

Are you running arm64 or amd64 images? I switched from docker to podman, mostly due to other issues (e.g., the weirdness with the Docker VM seemingly growing infinitely in size and refusing to trim automaticity), but running arm-native containers has never really made my battery life significantly worse.

The 12+ hours, though, I’m not sure how people are getting that consistently. I feel like VS Code and some LSPs alone make that impossible for me.

I can’t imagine if I were doing some web dev stuff and needed Chrome installed of Safari too.

Run arm64 ubuntu in a VM and use arm64 images and it should be very fine?

I have a 256GB (with easy/cheap room for 768gb) 28c haswell-e server sitting in my basement though too. Costs like 1/3 of a macbook pro if it comes down to it.

I switched to using Podman when the licensing terms came out and it was clear we weren’t going to be able to get a procurement through. The move was generally painless and the battery life is great - no noticeable impact unless I’m actually hammering the CPU in a container.
I use my company-provided M1 Pro MBP for mobile dev (Xcode, Android Studio) and battery life and heat are both great for that use case. Very rarely run Docker, but when I have it's seemed more resource hungry than anything else running.
Can't you run Docker on a remote host? I always have a 64GB memory EC2 instance near if required.
You could also launch a Linux VM and run your docker containers in there. That ought to work better than just running docker in Mac OS and letting it manage VM instances on its own.
You shouldn't pay more money for a top-shelf laptop, then need to do this.
Can confirm.