Live data from Hacker News

Docker on MacOS is slow and how to fix it

paolomainardi.com

81–90 of 211 posts

Re: Docker on MacOS is slow and how to fix it

#81
post #60

Funny that this came up — shameless plug: I've actually been working on a new Linux+Docker+Kubernetes solution for macOS recently! Already added quite a few improvements over existing apps including Docker Desktop, Rancher, Colima, etc: - Fast networking: 30 Gbps! vs. 150 Mbps with Docker VPNKit. Full VPN compatibility, IPv6, ping, ICMP and UDP traceroute, and half-open TCP connections. - Bidirectional filesystem sha…

What are the tradeoffs?

Re: Docker on MacOS is slow and how to fix it

#82
post #19

Earlier quoted context omitted.

My preferred fix: don't develop in Mac.

For many Mac is the only sensible option. There's one developer in our company that uses Linux and it's a lot of pain to setup. Mac has the best balance between coding, utility tools and "other work stuff". Windows probably on par if not more for "work stuff" but falls badly in the coding & tooling department. Linux is OK ish for coding and utility but falls behind for "other work stuff" and certainly a pain to just…

> but falls badly in the coding & tooling department.

That's more perception than reality, often from people who simply don't know how to use Windows.

Visual Studio, Visual Studio Code, and IntelliJ IDEA blow any Linux text editor out of the water for developer productivity.

For Linux workloads there is the Windows Subsystem for Linux (WSL 2), which now even supports GUIs with GPU acceleration!

Visual Studio Code can even operate in "remote" mode where it tunnels into a Docker container or Linux server and acts as-if the remote target was the local machine.

On Windows, x86 and x64 Linux Docker containers run in process isolation at full speed, unlike on Macs where there is CPU emulation required.

Re: Docker on MacOS is slow and how to fix it

#83

Earlier quoted context omitted.

For many Mac is the only sensible option. There's one developer in our company that uses Linux and it's a lot of pain to setup. Mac has the best balance between coding, utility tools and "other work stuff". Windows probably on par if not more for "work stuff" but falls badly in the coding & tooling department. Linux is OK ish for coding and utility but falls behind for "other work stuff" and certainly a pain to just…

> but falls badly in the coding & tooling department. That's more perception than reality, often from people who simply don't know how to use Windows. Visual Studio, Visual Studio Code, and IntelliJ IDEA blow any Linux text editor out of the water for developer productivity. For Linux workloads there is the Windows Subsystem for Linux (WSL 2), which now even supports GUIs with GPU acceleration! Visual Studio Code can…

> Visual Studio Code, and IntelliJ IDEA blow any Linux text editor out of the water

But those tools themselves work on Linux.

Re: Docker on MacOS is slow and how to fix it

#84
post #33

Often overlooked: there is also podman machine and podman desktop (for windows and macOS). It is not as fancy as docker, but fully free and open source. It provides docker compatibility to some extent, you don’t need a license and it’s much less heavy than docker desktop. If you need kubernetes, there is also minikube, which provides a lot of options. Most of the things discussed in this article still apply for podma…

I've recently tried podman on a Mac and `podman machine start` failed with an “unknown error”. It was a disappointment.

I had similar issues when podman desktop first came out. Working much better on a re-try this week.

Re: Docker on MacOS is slow and how to fix it

#85
post #33

Often overlooked: there is also podman machine and podman desktop (for windows and macOS). It is not as fancy as docker, but fully free and open source. It provides docker compatibility to some extent, you don’t need a license and it’s much less heavy than docker desktop. If you need kubernetes, there is also minikube, which provides a lot of options. Most of the things discussed in this article still apply for podma…

I want podman to be a drop-in replacement, but it just isn’t there. I’ve wasted more time running down random errors I podman, so much so that I’ve switched back. Maybe in another year or two…

Re: Docker on MacOS is slow and how to fix it

#86
post #81
post #60

Funny that this came up — shameless plug: I've actually been working on a new Linux+Docker+Kubernetes solution for macOS recently! Already added quite a few improvements over existing apps including Docker Desktop, Rancher, Colima, etc: - Fast networking: 30 Gbps! vs. 150 Mbps with Docker VPNKit. Full VPN compatibility, IPv6, ping, ICMP and UDP traceroute, and half-open TCP connections. - Bidirectional filesystem sha…

What are the tradeoffs?

It cost money sounds like the big one

Re: Docker on MacOS is slow and how to fix it

#87
post #80

Earlier quoted context omitted.

Apple laptops definitely have issues sleeping. https://forums.macrumors.com/threads/macbook-air-m1-doesnt-s... There's a litany of bugs in Apple's software. This often gets hidden because developers use workarounds of various sorts, but if you know, you know. It's honestly embarrassing how buggy Apple software is given the vertical integration you describe. The worst part is that almost all of it is closed source so…

> There's a litany of bugs in Apple's software. Personally, the only problems I've only ever had getting macos to sleep properly has been when I've been running VMs. (Hello docker!) When doing purely OS-local development (which is all I ever do these days, because I value my sanity) macos works great. (So long as you have a recent mac. New macos + old laptop is awful.) But as nice as macos is, XCode is an absolute me…

Again, the reason it seems great to you is because developers have papered over so many bugs and other deficiencies. Linux has its own issues but it overall is at a completely different quality level from macOS.

Re: Docker on MacOS is slow and how to fix it

#88
post #81
post #60

Funny that this came up — shameless plug: I've actually been working on a new Linux+Docker+Kubernetes solution for macOS recently! Already added quite a few improvements over existing apps including Docker Desktop, Rancher, Colima, etc: - Fast networking: 30 Gbps! vs. 150 Mbps with Docker VPNKit. Full VPN compatibility, IPv6, ping, ICMP and UDP traceroute, and half-open TCP connections. - Bidirectional filesystem sha…

What are the tradeoffs?

In general, I don't expect anything to be worse than existing solutions, but not everything will be better.

Enabling Rosetta can have a minor performance hit on memory-intensive workloads in the VM (not only x86 ones) because of TSO memory ordering, so it'll be optional. Hypervisor.framework doesn't have an API for third-party VMMs to set this and doesn't seem to let the VM modify ACTLR_EL1 either, so unless I can find a private API for it, I'm stuck with Virtualization.framework's limitation of Rosetta being either on or off for the entire VM at boot time.

Memory usage is probably the biggest uncertainty right now. It should be at least slightly better, but I'm not sure if I can improve it much more due to Virtualization.framework limitations. Still looking into it.

Networking is implemented with my custom userspace proxy for VPN compatibility. Servers are forwarded to localhost automatically, but you can't connect to the VM by IP because the network doesn't exist from the host's perspective. I've ran into too many issues with Apple's NAT setup and host-only networking is a private API, so this is postponed for now. Should be able to do better with root.

Graphics won't be supported at launch, but I could look into it later if there's interest. Not sure how feasible acceleration will be if I can't find a way around having to use Virtualization.framework.

Let me know if there's anything specific that I missed!

Re: Docker on MacOS is slow and how to fix it

#89

Earlier quoted context omitted.

Have fun managing osx and Linux dependencies then when you could just maintain one.

In the languages I work with (primarily JavaScript and Rust), cross-platform compatibility tends to be pretty much a non-issue. I develop on macOS, deploy on Linux, and it Just Works. No extra work required.

[dead]

Re: Docker on MacOS is slow and how to fix it

#90
post #50

Earlier quoted context omitted.

Have fun managing osx and Linux dependencies then when you could just maintain one.

If you're not IT, god speed y'all, then it's not all that bad honestly. I set up my stuff with Ansible and 90% of the "porting" work was the mapping between rpms and brew packages. The only headache I get sometimes is because I have the GNU utils first in the path which makes compilation scripts mad sometimes.

[dead]
Post reply on HN