Live data from Hacker News

Docker on MacOS is slow and how to fix it

paolomainardi.com

31–40 of 211 posts

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

#31
post #19

My preferred fix: don't develop in Docker.

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 keep it updated.

So in our company, everyone in the development & support team uses Mac (except this one guy who insisted in Linux), most in the sales & marketing team use Windows.

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

#32
post #29

What sort of workloads are people doing where the filesystem access is limiting them? I develop python web apps on a mac and use dockerized postgres and a dockerized flask app. I don't seem to experience any noticeable issues. When I am developing I mount the source code directory as a volume so code edits are synced live into the running docker container. I also develop frontends using vue, managed by npm. In my exp…

I tried running our Golang mock generator through Docker on an M1 Mac and it was much slower than running it directly on the host. Probably since it reads every file in the codebase and writes out a file for every interface it finds.

mockery? That thing runs super slow just on its own.

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

#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 podman machine and minikube.

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

#34

My preferred fix: don't develop in Docker.

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.

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

#36
post #11

Earlier quoted context omitted.

the 'DOCKER_HOST' variable (and the fact that all SDK's seem to support it) is honestly the greatest bloody thing in the entire ecosystem. My workflow for the past 3 years with Docker has been: set up some desktop machine somewhere, configure docker, configure ssh like normal: set DOCKER_HOST=ssh:// on my laptop. Docker responds as if it's local, but I get absurd build/fetch speedup (since the wired connection is fas…

I assume port forwarding would be a pain in such a setup, right?

You just access everything on the docker machines IP instead of localhost. Dev servers may need an additional parameter for that, it i don’t see any big problems.

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

#37
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…

There's also Rancher Desktop. I don't know if it's less heavy, but it doesn't require a license and also includes k8s.

https://rancherdesktop.io/

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

#38

My preferred fix: don't develop in Docker.

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

That really hasn’t been an issue for me since Homebrew came out a decade ago - using Python, Rust, Node, Java, etc., all of which have mature stories for cross-platform development. The main area I’ve run into problems are legacy projects where it’s not “Linux” but more like “one old Linux distribution with a 32-but binary nobody can reproduce” and Docker is really the least troublesome part of those projects.

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

#39

What sort of workloads are people doing where the filesystem access is limiting them? I develop python web apps on a mac and use dockerized postgres and a dockerized flask app. I don't seem to experience any noticeable issues. When I am developing I mount the source code directory as a volume so code edits are synced live into the running docker container. I also develop frontends using vue, managed by npm. In my exp…

One issue I ran into at my previous employer was pylint on a large Python codebase. Pylint is slow on the best of days, but the difference on an M1 Mac running under docker (to standardize the version and settings across the team) was something like 10x as slow; several *minutes* to lint the codebase, which we absolutely required before code could be checked in. It finally got a lot better when VirtioFS came out, whi…

Are your Docker images x86_64? On an M1 Mac x86_64 images run under qemu which is very slow, If an ARM64 image is available it should run a bit faster.

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

#40
post #37
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…

There's also Rancher Desktop. I don't know if it's less heavy, but it doesn't require a license and also includes k8s. https://rancherdesktop.io/

I didn’t try it out yet. But usually thing from rancher are awesome.
Post reply on HN