A project I made solved this by running docker on AWS and doing two-way file sync on changes. Runs quite nicely and transparently. https://github.com/lime-green/remote-docker-aws Lots of benefits: speed, battery, fan noise
Docker on MacOS is slow and how to fix it
71–80 of 211 posts
Re: Docker on MacOS is slow and how to fix it
#72Earlier quoted context omitted.
I'm not sure I understand the question? I close the lid. How do you do it?
It a jab at Linux/PC. Apple's completely vertical stack means that their machines never have issues sleeping. The huge variety of machines that Linux (and Windows) is expected to run on can cause problems entering S-states reliably. This issue is pretty uncommon (excluding the Windows modern sleep disaster), but that doesn't prevent comments like the GP throwaway.
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 it's harder to debug, and the bits that are open source (and have bugs in plain sight) you can't just submit a patch to. You have to file an rdar and hope it gets prioritized, which for one of the bugs I'm aware of hasn't been in many years. And so the workarounds keep getting written.
Re: Docker on MacOS is slow and how to fix it
#73Earlier quoted context omitted.
> everyone in the development & support team uses Mac (except this one guy who insisted in Linux), > certainly a pain to just keep it updated. > Linux and it's a lot of pain to setup. If you're not using Linux, how are you justifying these claims? > certainly a pain to just keep it updated. Excluding the boot time for both, MacOS takes between 15 and 45min to update. Linux is a few seconds. I suspect that the only OS…
How do I get my laptop to properly sleep when using Linux?
Re: Docker on MacOS is slow and how to fix it
#74Is not this the main way to speed up Docker on Mac: use a beefed up Linux Virtual Machine (VirtualBox, UTM, tart) and run Docker inside this Virtual Machine?
This assumes you want a distinct storage drive within your VM. Many developers prefer to code in their host OS but run the image via Docker for Mac. They also want instant real-time code changes to appear inside the running Docker image. I suppose you could have some of the disk live within the VM and the code portions be memory mapped or Rsynced. I haven’t thought through the downsides.
Nowadays make sure you use their new virtual machine thing in docker for Mac and add :cached in your compose file of any mounted volumes and I found that alleviated my issues. It used to be really bad though.
Re: Docker on MacOS is slow and how to fix it
#75Earlier quoted context omitted.
One can be using something that isn’t Linux for development and still be familiar with it. Perhaps they did in the past? Perhaps working in the same team as someone exposes them to the alleged headaches? This is a thread on Hacker News, not an academic article. You aren’t owed a massive amount of “justification” for these “claims”.
> You aren’t owed a massive amount of “justification” for these “claims”. I was using Mac for development due to company policy (compliance). It is by far the worst development experience I have ever had. Brew is terrible. Updates are agonizing. The user interface is awful. Containers are a shitshow.
Re: Docker on MacOS is slow and how to fix it
#76Earlier quoted context omitted.
I'm not sure I understand the question? I close the lid. How do you do it?
It a jab at Linux/PC. Apple's completely vertical stack means that their machines never have issues sleeping. The huge variety of machines that Linux (and Windows) is expected to run on can cause problems entering S-states reliably. This issue is pretty uncommon (excluding the Windows modern sleep disaster), but that doesn't prevent comments like the GP throwaway.
This is a real issue with Linux. If you want the latest hardware, expect basic features like suspend resume not to work.
Re: Docker on MacOS is slow and how to fix it
#77Earlier quoted context omitted.
this is very true. not to mention it's very slow on its networking... i've given up docker on macOS long ago. If I was to use docker, I'll switch to my debian laptop. way much much faster.
Happy to give up Docker, but still using MacOS as a daily driver?
Just do whatever you're doing in docker natively in macos. Python, Nodejs, Ruby, Rust, Postgres, etc can all run as native macos processes.
The big advantage (aside from performance) is that you gain access to all the OS-native debugging capacities. You can just look at files, open multiple terminal sessions in the same folder, use Profiler, click the debug button without special configuration in your IDE, and so on. All without needing to think about VM images, docker containers, networking and all that rubbish.
The downside is you need to set up a second build environment (which might not match your deployment environment). Unless you're doing something truly special, setting up a macos-native build environment is usually pretty easy. Its normally just a few "brew install" / "npm" / "gem install" / "cargo build" etc commands away from working.
Re: Docker on MacOS is slow and how to fix it
#78Re: Docker on MacOS is slow and how to fix it
#79Earlier 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…
This is absolutely false. Windows is a perfectly fine development environment and has perfectly fine tooling. You just need to embrace powershell, windows tooling, and use cross platform tools. Too many devs put themselves in a corner by relying on posix shell or posix only tooling.
If you do user space programming your host OS should never matter. In my 10 years of programming the only time the host OS mattered was when I was writing Linux drivers.
Re: Docker on MacOS is slow and how to fix it
#80Earlier quoted context omitted.
It a jab at Linux/PC. Apple's completely vertical stack means that their machines never have issues sleeping. The huge variety of machines that Linux (and Windows) is expected to run on can cause problems entering S-states reliably. This issue is pretty uncommon (excluding the Windows modern sleep disaster), but that doesn't prevent comments like the GP throwaway.
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…
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 mess. Earlier today I was trying to import a swift package into xcode. The package looked fine, but XCode for some reason was only importing it as a "Folder Reference". Stackoverflow suggested quitting xcode and running "xcodebuild -resolvePackageDependencies", then relaunching xcode. And that fixed it! Why was that necessary? Why couldn't xcode figure that out on its own? What did that even do?? I have no idea. And I hate it.
These days developing in apple's ecosystem feels less like developing in a walled garden and more like developing in a swamp. They're truly lovely developer machines - just so long as you can stay away from xcode.