So is there some canonical guide to running a docker compose style app on Mac m1 machines that has good filesystem performance? It seems like there’s many ways to approach the topic now so it’s hard to tell which one is “winning”. I’d love to containerize all of my local development efforts (scripts and rails apps) but the slow ass filesystem always ruined it in the past.
Because docker for Mac has always kind of sucked, I’ve moved on to making nix-based development environments and I’ve been very pleased so far. Lately I’ve been trying https://devenv.sh/ and it works great! I haven’t tried it for ruby, though I have used vanilla nix shell for ruby projects before and it worked quite well after I over-rode GEM_PATH and GEM_HOME to the correct values.
LXD containers on macOS at near-native speeds
51–60 of 134 posts
Re: LXD containers on macOS at near-native speeds
#52This is cool and a worthwhile thing, but how is this different than the many (b/x)hyve clones and others based on QEMU that use MacOS’s virtualization framework to run a minimal Linux for containers? What’s the differentiator that makes this better (hopefully?) from what’s come before?
That said, there now seems to be a huge number of options for running various combinations of VMs and containers on Mac and Lenix now. I just use whatever seems popular and is easy to set up, but I have no sense of the pros and cons among them. I would love a coherent document on this topic.
Re: LXD containers on macOS at near-native speeds
#53> Prerequisites Install QEMU So in other words, qemu runs at near-native speeds?
Yes, on recent MacOS it is mostly just an abstraction on top of the native Virtualization Framework.
Re: LXD containers on macOS at near-native speeds
#54this is so .. exciting! .. however please recall that you the user are now using hardware that is remotely run in most cases by the OS vendor (and who-knows-what-else), with opaque code executing at multiple layers.
Re: LXD containers on macOS at near-native speeds
#55> Prerequisites Install QEMU So in other words, qemu runs at near-native speeds?
Yes, on recent MacOS it is mostly just an abstraction on top of the native Virtualization Framework.
Re: LXD containers on macOS at near-native speeds
#56Earlier quoted context omitted.
No, QEMU runs an ARM VM. Inside that VM, Rosetta for Linux can be used to run x86 executables, just like on macOS.
so arm macbooks are still problematic for developers who use containers and x86 servers... it's still surprising to me that they did this as i always got the sense that developer word of mouth helped drive a lot of macbook adoption in the 2000s.
I use ARM containers locally to dev and test locally, check in the code and the build server creates an x86 image for deployment to the server.
Worst case you have to build the ARM container yourself locally and tag it with the "remote" name and docker will just use it instead of pulling the remote version.
Re: LXD containers on macOS at near-native speeds
#57Earlier quoted context omitted.
Because docker for Mac has always kind of sucked, I’ve moved on to making nix-based development environments and I’ve been very pleased so far. Lately I’ve been trying https://devenv.sh/ and it works great! I haven’t tried it for ruby, though I have used vanilla nix shell for ruby projects before and it worked quite well after I over-rode GEM_PATH and GEM_HOME to the correct values.
I've been using Colima lately and it's been a great experience. The only thing that didn't quite work was pushing an image to AWS ECR, but pulling images, building images (with BuildKit), and running containers all worked fine, and faster than Docker.
Re: LXD containers on macOS at near-native speeds
#58So is there some canonical guide to running a docker compose style app on Mac m1 machines that has good filesystem performance? It seems like there’s many ways to approach the topic now so it’s hard to tell which one is “winning”. I’d love to containerize all of my local development efforts (scripts and rails apps) but the slow ass filesystem always ruined it in the past.
Because docker for Mac has always kind of sucked, I’ve moved on to making nix-based development environments and I’ve been very pleased so far. Lately I’ve been trying https://devenv.sh/ and it works great! I haven’t tried it for ruby, though I have used vanilla nix shell for ruby projects before and it worked quite well after I over-rode GEM_PATH and GEM_HOME to the correct values.
Re: LXD containers on macOS at near-native speeds
#59> Prerequisites Install QEMU So in other words, qemu runs at near-native speeds?
QEMU can use the MacOS virtualization framework layer to run a VM built for the same arch without going through any translation. From there you can register Rosetta as a runtime and use it to run x86-64 Linux apps on ARM64 if you want. ( https://developer.apple.com/documentation/virtualization/run... )
Re: LXD containers on macOS at near-native speeds
#60So is there some canonical guide to running a docker compose style app on Mac m1 machines that has good filesystem performance? It seems like there’s many ways to approach the topic now so it’s hard to tell which one is “winning”. I’d love to containerize all of my local development efforts (scripts and rails apps) but the slow ass filesystem always ruined it in the past.
Have you tried enabling Virtiofs in Docker Desktop? On my M1 Mac that sorted the performance for me for large PHP apps, and I haven't experienced the permissions problems that some people have (there is a test build that appears to fix those out now).
I think the new virtualization framework just came out of beta though so now it’s just VirtuoFS that needs to be enabled.