Docker for Mac M1 RC
docs.docker.com
docs.docker.com
I had a lot of issues with Brew, but the biggest one was how slow it was. Upgrading all packages on my Mac used to take hours.
Installing anything with brew involving multiple dependencies is also taking forever-ish, compared to mere seconds with apt.
If you don't run it daily, it takes about a minute or two to update.
But even when it doesn't update, it is extremely slow compared to any other package managers. It is disruptively slow and it takes a lot of resources, even in a powerful machine (and I'm not talking about compilation here).
I do like tools to be as fast as possible, though, and I’d forgotten about that update it does sometimes when I run it - that does seem to take a long time.
I’ll have a look at how it works and see what the things are that take time. I would expect network traffic for updates, perhaps whatever it’s getting updates from does some processing (I’m sure it said something about GitHub), perhaps there is some dependency resolution that needs CPU...
It would be interesting to compare its architecture to other package managers if they’re significantly faster.
99% of the time, installing a package consists of downloading a few zips from their CDN, decompressing and linking. For those cases Brew could just be checking an API instead of constantly cloning the git repository.
I'm quite surprised nobody has reimplemented it in Rust or Go. The architecture is quite simple compared to a normal package manager. Maybe it's just superstition: people see "package manager" and assume it's complicated instead of digging into the code and finding out how it works.
https://applehelpwriter.com/2018/03/21/how-homebrew-invites-...
https://askubuntu.com/questions/261326/is-it-safe-to-chown-u...
It’s also just so slow to update if it’s been more than like an hour since you last updated, the way it uses one big git repo under the hood is just chaos.
What you're looking apt is apt-holding:
apt-mark hold libxfont1
That been around since 2013 IIRC. And there was dpkg way of doing it before.
You can install specific versions, but it requires some gitfu - you need to uninstall, find the brew commit where the package is at the version you want, then install from that specific git blob.
For example, when postgresql 12 was released, it took some months to appear in brew. Meanwhile you could not use alternate taps to resolve dependencies, if some package required postgres, it had to be the original one.
Those times are way gone, that's the purpose of containers.
I've been using Brew for a while to just install "core" packages like python, curl, wget and such, and everything else like a postgres, nginx, whatever..a go to a container.
Also, I have some tools installed with brew, that have postgres as dependency (e.g. pgloader or mapnik).
- Homebrew is a general purpose package manager, and Postgres is a package you might want managed.
- If you're using Docker/Docker Compose for a project anyway, that's the obvious way to do it.
- Postgres.app is a specialized tool just for managing Postgres installs, so it's hard to beat if that's what you need.
Some thoughts on the tradeoffs though:
- Homebrew really doesn't like the idea of "versions". It wants everything to be on the latest. That can be fine if you just need a tool locally, but if you want dev and prod to match, it is a pain in the ass.
- Docker isn't really very good at persistence. That's probably not a problem for local development, but you should be aware of it. Running it on a Mac introduces speed and memory issues you wouldn't otherwise have. And now obviously there's the M1 problem.
- Postgres.app is another thing to install. If you just need Postgres for one particular project you might not know about it or want to deal with installing something new.
Please elaborate on the claim that "running a SQL database" is the purpose of containers.
However, if I do some exploratory experiments, where I don't care about repeability and where I use other local tools (like the mentioned mapnik, or jupyter), having it in container is needless complication.
By and large, there’s no such thing as a container, there’s just sprinkles of housekeeping magic. To wit, Docker implemented in around 100 lines of bash:
https://github.com/p8952/bocker
Problems come when we think that today’s containers manage to actually contain anything, bring any security guarantees, or do much else than just slightly-more-successfully jump start a configurable bundle of dependencies.
Why wouldn't you want to run a database under VT-x, with random emulated hardware and a dependency-bundled disk image? By and large there's no such thing as a VM, there's just sprinkles of housekeeping magic?
Containers as specced and implemented do come with security guarantees. And if they fail to meet them it's a bug.
[0] https://www.reddit.com/r/blender/comments/jsc03l/blender_on_...
Docker and Developer Tools does not happen to be one of them.
When you say "proper Linux distribution", I assume that's still CLI only? Do you develop with e.g. emacs, vim on WSL, or do you have some IDE with remote running and debugging into WSL? Or have a missed a trick and in fact X/Wayland applications can be run on WSL?
https://blogs.windows.com/windows-insider/2021/01/06/announc...
VScode directly connects to WSL. You can open folders/files with 'code <folder>' from the WSL terminal, save, run whatever from VScode etc.
As for Docker, you can also use the GUI from within Windows that automatically connects to WSL but admittedly I almost never use the GUI.
If you install an X server on Windows you can run graphical WSL apps. It runs really well too. Years ago I used to run Sublime Text straight from within WSL.
I've been using WSL / WSL 2 for a few years now for full time web development. A while back I made a video going over all the tools I use and how I have Docker, WSL 2 and a bunch of other things configured at: https://nickjanetakis.com/blog/a-linux-dev-environment-on-wi...
No. WSL2 uses it's own, minimal (proprietary) init, which basically launches default shell for the configured user and that's it. No service management in sight, and no equivalent of systemd's user scope or user session either.
That said, I've been playing around more and more with WSL2 on a secondary machine as a current primary Fedora user (for about 10 years now) and I really haven't found a good reason why I would need systemd in the WSL2 VM vs the custom init.
Most WSL2 users use it as shell to run occasional ELF/x64 binary that runs in console; for services, they would use Docker Desktop for Windows. Anything beyond that and you will quickly find out, that it is not really a standard linux distribution.
In practice that hasn't been a roadblock for me, because VMWare Workstation 15.5 finally supports running on top of Hyper-V, so I can have both working at once. Moving everything to a single hypervisor API has some nice benefits...
/s, obviously.
With openssh in windows, it's been quite easy to run an x server in windows, and use ssh with x forward for gui access.
But rdp feels more native to windows, and both x and Wayland has rdp server backends - so you can do things like: https://www.nextofwindows.com/how-to-enable-wsl2-ubuntu-gui-...
But apparently ms is working on a Wayland compositor allowing directly running gui apps - I don't think it's quite there yet:
https://www.phoronix.com/scan.php?page=news_item&px=Microsof...
https://github.com/Microsoft/WSL/issues/938#issuecomment-763...
Somewhat related: https://ltsp.org/ I'm not sure about the state of a non-x rdp server for thin clients though.
From the look of it, if I were to set up the WSL2 Ubuntu GUI with RDP, that'd tick all the boxes, right? And as a bonus I'd be able to access files in WSL2 from Windows.
Any idea how WSL2 interacts with VPNs? I've seen some mixed reports around the web but this is also a must-have for me, if I can't use a VPN in my dev environment it's game over.
P.S. thanks for making an account just for this reply :)
Fwiw wsl2 runs in a vm now (hyper-v). AFAIK it's in order to increase fs performance "inside" Linux (so faster compiles if compiling in wsl).
It's also possible to use cifs/samba shares - but I don't know what you're compiling? Chrome/Firefox sized c++ projects?
Might be worth it to try with a tmpfs/ramdisk either way?
Note this only impacts calling the Linux go toolchain from the Windows side (via the /$wsl/ path). Its not an issue inside WSL... but it comes up when you want to say configure Windows IntelliJ/GoLand to use the Go compiler hosted inside of the WSL VM.
> When you say "proper Linux distribution", I assume that's still CLI only? Do you develop with e.g. emacs, vim on WSL, or do you have some IDE with remote running and debugging into WSL? Or have a missed a trick and in fact X/Wayland applications can be run on WSL?
You can run X apps just fine in WSL2 as long as you have a display server running on the Windows side. I use X410. Important to note, Microsoft is working on native Wayland support long term. For what it is worth, I run IntelliJ/GoLand from inside of WSL and use X410 to render the GUI. This works great.
> I think my end goal is to have a contained development environment whilst not being forced to use specific tools (i.e. VSCode remote debugging, eugh) and not sacrificing compilation times by running in a VM that's too slow.
Are there any other gotchas to working like this? As it happens I'm a go dev using GoLand so your go-specific issues are of interest to me. I'm not too bothered about not being able to use Windows GoLand as I'd be just using it from WSL2 anyway, but I'd be interested to know if there are any other pain points. Any issues with VPNs, if you're using them?
Edit: Im switching from Fedora to a WSL setup for work in the next week. Ill report on issues I encounter in that migration. I suspect VPN will come up because one of the key reasons im switching off Fedora to Windows+WSL is due to corporate VPN requirements.
a) It doesn't play well with deep sleep mode, and crashes. Perhaps it's been fixed, I don't know, I just disabled deep sleep.
b) The networking is different than WSL1 and requires odd workarounds for things like X11 to work normally. I had to use a 192.168.1.x address for DISPLAY instead of localhost. Which required some VB scripting to reliably work for me.
Other that this I love Windows 10 + WSL2 as a dev environment.
I believe one of the issues laptop-related, and I work exclusively on a desktop these days, so that was a non-issue for me.
https://code.visualstudio.com/blogs/2020/07/01/containers-ws...
So the main thing Apple could do to show some love to docker is build out full apfs support in the Linux kernel. I have no clue how much work that entails but presumably it’s pretty massive, and it seems totally unlike them. Maybe one day they’ll have a come to Jesus moment like Microsoft and start caring about developers (non-iOS developers) but I don’t really see it happening.
Have you considered storing the npm_modules and running webpack on a tmpfs/volume (so that it doesn't have to go through the shared FS layers) and only copying the end product to a shared volume?
The newer Docker for Mac is better, but file system perf still could be massively improved. Big node_module directories can still cause pain even today
is there any other kind?
(The efficient thing about this class of solutions, if you’re wondering, is that the client mounting the loop-image ends up owning + managing the loop-image’s internal filesystem’s metadata within its own local disk cache, such that it can coalesce filesystem metadata writes and only push a new copy of the disk-image blocks backing the filesystem metadata after a potentially-huge number of changes. With a network/host-guest filesystem, meanwhile, every filesystem metadata change must become its own synchronous message to the host, to be pushed to the host’s filesystem driver for linearization, so it can succeed or fail relative to other things going on within the host.)
(on service definition): volumes: - .:/usr/src/app:cached - node_modules:/usr/src/app/node_modules/ - next_artifacts:/usr/src/app/.next/
and then in the top level volumes key defining node_modules and next_artifacts as blank/default.
That means I mount everything except node modules and the build artifacts so the shared filesystem does a LOT less work trying to sync stuff. The downside, of course, is that I need to run npm commands both inside the container and outside if i want them in my IDE. A fair trade for decent performance. That setup is still not as fast as native but definitely usable and does not send my machine into space header mode much more than normal usage.
After eventually falling in love with it on Windows and Linux, I later tried it on MacOS... oh my. Not fun!
Don't get me wrong. They were good workaround years ago. But I hope we can do better.
I was developing a database as a personal project that involves mmapping a file and the Docker shared filesystem had some peculiar behavior they was different from how normal filesystems work.
So much Unixness on the Mac OS boot ROM, the Pascal API, the lack of memory protection, and so on...
Seems to be some signing issue but it’s only happened to me twice and I didn’t have time to properly investigate at the time...
Have there been some updates recently? About a year ago we were trying to use Docker on a windows host at work, and dealing with things like file system paths was a nightmare
Technically there shouldn’t be file system issues right?
You do have the occasional issues regards line endings; that's the only negative I've had so far.
EDIT: H12 is more accurate. The Linux OS is separate, but the Windows FS is mounted to a logical place and "just works".
https://docs.microsoft.com/en-us/windows/wsl/compare-version...
https://devblogs.microsoft.com/commandline/access-linux-file...
https://community.openbiox.org/d/72-windows-subsystem-for-li...
And not all are minor. Not being be able to run LXC is a deal breaker for me.
(disclaimer: not directly involved with WSL, just trying to help)
I don't see how it's useful to say that it's a "modified kernel" due to it being packaged for a specific application in a way that is necessary to use it.
WSL is really remarkable.
Not if your Windows users have to use Direct Access to connect to your container registry...
However, when I last spent a couple of sprints attempting to get them working side-by-side, it was a pretty big failure. I couldn't get VirtualBox 6.0 running without falling back to soft virtualization which was painfully slow (booting a Ubuntu box took the better part of an hour).
It's a planned initiative for the future, but it means a fundamental change in a number of tools and would require a rather large set of rewrites.
On top of that, out of the large pool of users, only a small handful would actually need to run Docker side-by-side with these tools, meaning that it's a huge rewrite to allow a small number of people to use Docker on their desktops. That ultimately means it's getting very little traction and keeps getting pushed down the backlog.
Last time I checked, the terminal was horrible to work with.
No need for WSL.
I used starting fresh on the M1 as an excuse to give MacPorts a go, and I like it much better than Homebrew. There's some smaller packages that aren't on MP, but all the big stuff is there and to me it feels much more like a Linux package manager.
Over time I'm not sure brew is any better now, though. I have unlinked versions of gcc, python, etc., etc. under /usr/local that are there just to handle brew packages that listed them as pinned dependencies. It's nice that brew doesn't expose them to CLI unless I want it to do so, but it's not less complex.
Assuming MacPorts has a good "bottle" type concept of precompiled packages now too (haven't looked for years) it's probably about the same as brew now, just more stable. If they still compile from source every time a la BSD, that would be my main sticking point.
https://saagarjha.com/blog/2019/04/26/thoughts-on-macos-pack...
Anyone tried Nix? I'm trying it soon. If it doesn't stick, yep, back to MacPorts like it's 2007.
If I were Apple (ehem) I'd spend a small but meaningful budget supplying devs to projects like Docker or TF to help speedup M1 adoption. Given that the chip market is open for grabs I'd say it could give Apple a much stronger headstart with their in-house silicon strategy, even if that means helping improve products or the bottom-line for well-established corps, some of them competidors.
The M1 migration is less than a year old and it’s already the single best/ most successful CPU migration in my memory. Far better than Apple’s PPC -> Intel Migration and massively better than whatever half-steps Microsoft has done to port over to ARM.
Apple absolutely should invest in much of what you suggest. In 6-12 months, after the platform is complete and mature enough to identify where the big problems are.
Most of us understand that you exercise caution when migrating mission critical work onto a 6 month old platform.
In the mean time, Apple has been hiring top Docker talent like Michael Crosby.
https://www.protocol.com/apple-hires-cloud-open-source-engin...
It’s possible they are hiring top container developers just to improve their internal cloud infrastructure. But what kind of hardware do you expect these guys will be running?
EDIT: Trimemd some repetitive stuff.
I like having the system strictly separate from my crap, and I think the UI is fairly good. The variety of packages available out-of-the-box is outstanding. I miss it when I'm on Linux, now, in a workstation-not-server context (yes, I know, there's LinuxBrew, but the package set is much smaller and less well-maintained). I started on MacPorts but got sick of it borking itself every few months such that it was faster to nuke the directory and reinstall everything than to figure out what it'd screwed up this time (granted, that was about a decade ago, maybe it's great now).
Brew gives off all kinds of signals of being something I'd hate (cutesy; a system tool written in Ruby; breaks with norms) but I like it a ton.
I've never used linux as a dev machine, but in general apt seems much more reasonable in this regard. My frustration with Brew is pushing me to seriously consider a linux machine, so if anybody has counterpoints here I'm definitely interested in hearing about your experiences.
I don't care that Brew "breaks with norms" I just care that it breaks my shit.
So I end up with:
System -> Apple-managed
My tools, as in programs I personally use -> pretty much entirely Brew, in fact I think on my current workstation this category is 100% brew-installed
Dependencies of anything I'm working on -> some language-specific version manager (which itself is may be brew-managed, actually) plus containers or VMs with scripted installs, probably.
On linux my experience is typically more like:
System -> package manager
My tools -> package manager, plus some sketchy extra repos that I hate to add but do anyway because I don't want to screw with manually updating things, plus several things installed manually, plus a bunch of things on older versions than I'd like but not worth the trouble/risk of finding some way to upgrade without it being a PITA.
Dependencies of anything I'm working on -> some language-specific version manager (almost certainly not available in the distro's official repos) plus containers or VMs with scripted installs, probably.
So for my use, Brew cleans up the "My Tools" workflow very nicely compared with Linux, excepting, kind of, my days back on Portage/Gentoo, which of course has its own problems.
Only difference I see is that my containers are running natively (eg no VM in the background) and that I've not had any random errors from my package manager in years. Not sure what brew is like these days but last I used it the experience felt like a half baked apt/yum to me (3+ years ago though)
For me, Brew is for managing my personal software I use that doesn't come from Apple. Project dependencies, including the version of the compiler or interpreter for the language you're writing, don't belong brew-managed in most cases, which seems to be what's tripping people up when they try to use it for that.
Yes, containers run better on Linux because they're native. No quibble there. I just find I'm much, much better able to cleanly manage my personal software (not project dependencies, which, again, I wouldn't try to manage with my workstation's Linux package manager, either) with Brew on macOS than in any Linux distro I've used. 99% of what I ever want to run (outside the base OS, and project dependencies) is on there, available at a single "brew install", after I do nothing more than install Brew itself, versus 50-95% on Linux (depending on the distro), where I find myself adding all kinds of extra repos and installing one-offs a variety of ways just to get to a baseline level of having all the stuff I need at new-enough versions. And the interface is above-average, in my opinion (but again, Portage/Emerge is my favorite package manager on Linux and maybe the only one aside from Void's that I've found pleasant to use, so I may just be weird)
Anything I need at a particular version gets installed some other way, unlike how I operate on Linux, where anything I need at a particular version plus a bunch of other stuff all gets installed outside the package manager (talking workstation usage specifically)
apt and yum don't go doing things you didn't tell them to do (usually)
https://www.postgresql.org/download/macosx/
Likewise Python and other programming tools where running a specific version is important are best managed outside homebrew.
Call of Duty is a whole other problem.
Too bad because a native apple docker would be really really useful. imagine:
FROM macos:10.13.3
RUN xcode-build
(I'm not talking about the current docker on mac which runs linux in a vm)BTW macOS being a BSD derivative of sorts might benefit from Docker development on FreeBSD, which uses jails instead of cgroups, etc. At least, that could be easier to port, assuming that macOS kernel has the needed facilities.
It is my hope that Docker continues to accelerate down its current path toward replacement by other systems such as podman.
I suspect that Apple has little motivation to add a Linux kernel alongside the existing BSD-compatible kernel, even though macOS does have a built-in hypervisor framework/API.
BSD containers (e.g. jails) seem like a better fit than Linux containers (e.g. docker, lxc) for a BSD-based system.
Tangent warning:
When WSL2 came out I ended up moving away from WSL and moved to running my development environment inside a VMWare VM and connecting to it via VSCode remote ssh development feature (the same one used for WSL). This is essentially a manual version of WSL2, something people have been doing for ages.
Now, whether I develop from Windows or MacOS, I am always connecting to my Linux VM. If I need to run docker, it's running in that VM.
I got to the point now where I forward my SSH port from my public IP to my desktop PC at home. When I am away from home (e.g. working in the office with my laptop), I connect to my desktop (via ssh on my public IP) and due to the seamless integration VSCode has for remote development, It feels like everything is running on my local device.
The PC is of course handling compilation, intellisense and all that good stuff while my laptop is essentially a thin client. The laptop now runs faster, has a longer battery life, doesn't spin up the fans and also doesn't need to be upgraded.
My home PC, electricity and internet bills are also tax deductible because I use them for work purposes.
I'm all in on VSCode Remote SSH development now. It works extremely well, I barely even notice I'm not programming on my own computer, and my laptop no longer sounds like a passenger jet taking off. It was very easy to setup. Our stack is still very Docker heavy, but using the containers on a remote machine makes it much more tolerable to work with.
From what I remember the only requirement was that the dev environment stayed inside WSL2. Performance was native-like. With VSCode remote extensions it just works.
I still prefer Linux as a general development platform.
Based on my benchmarks it's more than twice as fast as Docker for Mac – and only minimally slower than native Docker running on a Dell XPS.
I'm enjoying this setup so much that I'm considering moving all my dev-related tools to a VM (which will hopefully allow me to get rid of homebrew too).
After numerous Docker woes on Mac I ended up just spending a tiny bit of time installing and configuring Nginx and various PHP-FPM and MySQL versions from MacPorts. It was easy, I learned a lot more about the platforms we use, and because they're all socket-based they can all be running at once. Just added a couple of bash functions to bring everything up and down.
Sure my dev environment isn't the same as prod, but it wasn't when I was using Docker either.
I like the simplicity of setting up a docker project vs. having to figure all the bits and config for your machine. But the slow fs is unbearable.
The one thing I wish they’d improve was re-establishing a connection after the computer sleeps. Really annoying to have to reload the entire window, sometimes.
I know not a big issue and I could use tmux, but I'm lazy.
The reload isn't bad for me -- it even keeps my text editors open with undo history. I'm not sure if I had to do something to enable that. There is probably a way to make it retain the integrated terminal, too (though you should really use tmux, it's awesome).
I’m guessing that doesn’t work for remote terminals though, I haven’t tried it.
Seconding what the other guy said though, tmux is perfect for this. If you use the iTerm2 tmux integration you don’t need to remember all the commands to switch tabs, scroll back, etc, it just feels local just like VSCode.
This problem has been solved with the M1 MacBook Air.
Though honestly... you should really try VSCode. You'll get a lot more than simple editing and remote commands (e.g. integrated debugging, etc). VSCode actually installs and runs a headless instance of itself on the remote, and decouples the UI from extensions, language servers, etc. It's a lot more than just editing remote files.
Try downloading it, creating a $5/month VM, and setting it up as a Remote SSH machine. I know it feels like a cult but it's far and away the best editor experience I've had. I switched from Sublime and was up to speed in a day because I could import all my keybindings. You can probably do the same coming from PyCharm.
It's so much better than Docker for Mac.
Huh. This could be problematic given that Docker disk performance on macOS was already dreadful on intel machines. I would love to see Apple give this some attention.
https://github.com/docker/for-mac/issues/5389
from a github comment: "Such a surprise every time I import a database to see it run about 10x slower than amd64."
Still an issue in the latest RC today
Not being open source I can't easily tell what sort of data it uploads during usage (but I did inspect the crashdump it uploads, and HOOOO BOY is it a fuckton of sensitive data about your running system), so being someone who usually works under NDA, even installing this on my machine is a liability risk, as it could transmit information about my customers.
You're better off using the actually open source docker command line client (installable from your favorite package manager) and setting DOCKER_HOST in your environment to something like "ssh://root@remotehost" (set up ssh key auth first, and install the docker daemon on remotehost) which will serve you a lot better, with the added benefit of running at full, non-emulated speed (and pulling images/packages/pushing/etc will happen from a datacenter pipe, not your puny leaf node on wi-fi).
I wonder if services like https://garden.io/ will see more business as a result of these issues? That or more folks will move to Windows or Linux as their primary development machine and reach for cloud-based Mac environments when they need to develop for Apple?
Run your dev environment remote and instantly rsync file changes and hot reload services. I’ve had an M1 Mac since launch day and not missed a beat since we don’t depend on local docker.
Garden supports in-cluster building, using buildkit or kaniko.
This way, you don't need to have Docker or k8s running on your dev machine as you're working.
It also automates the process of redeploying services and re-running tests as you're coding (since it leverages the build/deploy/test dependencies in your stack).
We also provide hot reloading of running services, which brings a similarly fast feedback loop as with local dev.
The idea is to have a dev environment that has the same capabilities as the CI environment, and to be able to run any/all of your tests without having to go through your CI system (which generally involves a lot more waiting).
The motivation behind Garden was that, like you, we had built our own home-grown kubernetes dev environments, but felt like there should be a polished, general-purpose framework + tool for this sort of thing.
• RBAC and secrets management (also makes it possible to control which users have access to which types of environments)
• Direct integration with GitHub or GitLab, so you could trigger something to happen in Garden based on a VCS event
• Automated environment cleanup (coming soon)
• Support and all that
See more: https://docs.garden.io/guides/container-modules#mounting-vol...
We only use the remote context. So basically it’s hot reload with all your services running on a beefy cluster somewhere else.
> horrendously slow piece of software on Apple computers, draining battery life like crazy
Exactly.
Thankfully there is Docker on Mac: how would my colleagues with shiny laptops get work done otherwise?
I have to unplug/replug my mouse every time I boot into Ubuntu because it's not recognised otherwise. Another wired mouse I have is not recognised at all (was working just fine during install).
As somebody who works 8+ hours a day, I don't have time for this shit.
In your experience - that's not uniformly true - I'm a counter example - I installed Fedora on this machine when I built it a few years ago (and have upgraded to each release) and have had zero hardware issues and that's running an RTX2080 with the binary driver (historically a pain point on Linux).
As someone who also uses a recent generation work issued mac the different for me is stark.
My point is, that an inconsistent experience is not something I have time to debug anymore. I ran Arch 10+ years ago when I had more time than sense, but those days are long gone. I'd rather spend my non-work time AFK.
I also purchased a ThinkPad T14 AMD. It works fine with Linux and all the hardware works out of the box (including the fingerprint reader, WiFi and webcam). Additional benefit: upgraded it from 16GB to 32GB for under 100 Euro.
I used Macs from 2007 until 2020. But in my daily work, I have experienced far more issues with macOS than with Linux in recent years (I was a very happy Mac user from 2007 to ~2015).
I was so impressed by it that it has replaced my Mac laptop as a development machine at home.
So do you always run the same server distribution with exactly the same package versions on your laptop? Otherwise, you miss the point of Docker.
You'd be surprised.
Container isolation is still OS-level virtualization. It just doesn't use a hypervisor.
No, I don't use WSL, and still get work done.
This "shiny/for the clueless" Linux-edgelord meme must die. Might as well write "MS" with a dollar sign in 2021.
Go to any programming conference and check the speakers. Over 50% use an Apple laptop. Check major developers people follow, from old Unix hands like Rob Pike, to every major JS cat, to admins, all the way to the creator of Gnome, Gnumeric and Mono, and their preferences, and you'll find they use a Mac laptop with macOS.
(And hardware wise, even Linus Torvalds had an Apple G5 tower as his main driver, and later an Intel Macbook Air he praised as the best machine he had used (though he used Linux on those).
In any case, there are benefits and tradeoffs, but "lol, Mac is teh suck" is inane.
To correct you: no, Docker is not used because "you need to". It's used (also on Linux) for reproducability, isolation, the ability to write code with different dependencies with the whole system at your disposal, and to not mix your driver machine with your development environment.
It is the same use if you run Linux distro X and deployed on another version of it, or on the same version with some tweeks/different libs, or to whole other distro.
And no, it hasn't been a "horrendously slow piece of software on Apple computers, draining battery life like crazy" for ages, and when it was it wasn't because of some macOS limitation, but because the company had done a half-arsed job with the fs layer.
And as far as "needing to use Docker", macOS is not any different than any Linux/FreeBSD distro on that front. If you prefer a local, mix-everything-in, not discliplined approach, unlike what Docker offers, you can install anything you like, from Brew, MacPorts, Fink and so on. You can even have Nix for reproducible builds under that scheme.
Exactly.
And I know Mac reigns in dev land. Just the moment Docker comes around (and it does quite a bit lately) all those shiny (and that's a compliment) pieces of hardware become heated vacuum cleaners.
I'm not saying "lol, Mac is teh suck" (what you apparently want to read). I'm saying: here's something that my Linux laptop wins at. Docker.
You come across rather angry, even saying that Linus uses Apple hardware without running the macOS... How does that work as an argument against my experience?
Nah, just replying to the rather snarky? "Thankfully there is Docker on Mac: how would my colleagues with shiny laptops get work done otherwise?"
>I'm not saying "lol, Mac is teh suck" (what you apparently want to read). I'm saying: here's something that my Linux laptop wins at. Docker.
Well, sure. There are other things a Linux laptop wins at. Tinkerability for example, part replacements, etc.
>even saying that Linus uses Apple hardware without running the macOS... How does that work as an argument against my experience?
It works as an argument that it's not something merely "shiny", but a good piece of hardware for a par excellence technical user.
Nope. I replied to someone saying Docker on Mac is a joke, and I agreed saying: one of the last points where using Linux compared to Mac is advantageous.
Saying Macs are shiny is a compliment. You took it as snarky, but it wasn't (before the new keyboards I preferred --and owned-- Macs).
> I'm not saying "lol, Mac is teh suck"
Biggest eye-roll post of the day. Literally one sentence after the other you suggest Macs are worthless and that you aren't saying they suck.
No shit. It’s running the same kernel. Docker on MacOS requires full virtualisation, which is a lot more overhead.
It works both ways; it will live as long, as "linux is useless, because I had a problem with wifi in 2002".
Having a 15.6" 1080p screen basically means i need to choose between using my glasses all day or using Windows.
On the other hand, I'm have no perfect eyesight, but in Linux, 1080p at 14" is as usable as Windows 10 at 125%. Here, the design choices made by Gnome are hitting its strong points, it is perfect resolution for @1X scale.
And OFC choose whatever theme, icon and font you like in order to match your resolutions.
Windows 10 is useless without scaling.
In the US. Not in Europe. The iPhone is barely testimonial there, while in the US, the iPHone has a good market chunk, and thus, more developers.
The old Unix hats mainly use Acme and MacOS as a dumb client against a 9front cpu(4) with Drawterm or with Plan9port.
The could use whatever it has a GUI to run drawterm on, as they did with Windows 2000 back in the day.
Also, OSX still has HFS as case insensitive by default. On modern Unix environments, OSX is useless. Period.
I run 3-5 rails servers, redis, postgreql, mysql, jetbrains ides, slack, meet, spotify, vscode, and probably two or three other apps I forget now. I do all this on either my 2014 15” MBP i7 or my 2019 13” MBP i5. The only thing I lack is drive space.
I have reinstalled my 2014 OS never, and I have a truckload of usb devices (mostly music production) attached.
You simply cannot match that with a Linux laptop. I love Linux, but not for desktop use.
And the M1 still amazes me every day. I code all day long, watch youtube, listen music, do zoom and slack calls and so on and don't charge my MBP even once during the day. I once forgot to plug in my laptop in the evening and the next day I was surprised that by mid day my battery was down to 10% after working on it for 1.5 days without charging. That's when I realised how long it lasts and that I got used to not charge it like my iPads or phone.
Also never gets hot and no fan noise yet.
I swear by 13 inch but I know I'm in a minority. I don't need a huge screen for my work. I like to look at code without bending my neck left and right all day long and if I need to multi task I four finger swipe left or right and feel extremely productive this way for many years now :)
EDIT:
I shall say I had an 8GB intel MBP before and 8GB was just about enough for everything including Docker.
You can't see all of a 15" screen without bending your neck?
You think 15" is a "huge" screen?
I have fallen in love with the 13" size. I still have my 16" computer and I pulled it out the other day and it looked comically large on my lap. It seriously felt ridiculous. I couldn't believe that was my standard for so long. The 13" is still good enough to do most anything, but small enough to really be portable. My mom has an 11" air and it feels like a kids toy in my lap, too small for my liking. But the 13" MBP is right in that Goldilocks zone.
I will admit I turn down screen scaling down to minimum to get more stuff on the screen. The default screen scaling state makes things quite large out of the box.
If it is a personal Mac, I would still go for the 16GB version, but purely for longevity. With 16GB you can probably use the MacBook longer. Also, less swapping means less SSD wear.
(16GB should really have been the default, at least on the MacBook Pro.)
Also, 8GB additional memory is not expensive at cost price. They could use the different amounts of baseline memory as a differentiator between the Air and Pro, especially now that the delta between the Air and Pro is so small (same SoC plus one more GPU core, Touch Bar that a lot of people hate, better screen).
I originally bought the 13" MBP on M1 because I was in desperate need of a new laptop. I previously had a maxed out 16" MBP that cost me around $3,500. I had used it for about 5 years and was looking to replace it. But Apple's systems were in flux and I didn't want to drop $3,500 again on an intel macbook right as they were going out of production. So when I saw the new M1 macs released, I decided to buy the $1,200 13" MBP with 8Gb of RAM and a 256HDD. Just the base model. The idea was that I would use this computer for a year, until Apple released the 16 inch "big boy" models. Then I would sell the 13 inch and get the real 16 inch that I was waiting for.
But when I got my new mac in November, I started using it and was just so amazed by the performance that I realized it could do what I was asking it to do, plus I loved the size, the epic battery life, and the no fan noise. I essentially fell in love with that computer. When I went back to my 16" macbook it felt so large and heavy, I wanted nothing to do with it. Even if Apple fixes the fan noise (that the 16" is horrible with) and the battery life, I still hate the size. I had truly fallen in love with the 13 inch computer I already had. And it was less than half the price I had planned on spending during my computer upgrade.
I originally bought the 13 inch macbook pro as a stop-gap until the 16 inch models were available on M1. But after using it, I decided that this was going to be my new long term computer. So at the end of the return window I had about 6-8 weeks using the computer. I had never had any trouble with the 8Gb of RAM. BUt my mind just kept telling me that 8Gb wasn't enough.
Since I was already upgrading the computer for more SSD storage, I really went back and forth on whether to upgrade the RAM as well.
The reason it was such a hard decision is that I couldn't pinpoint a single time when I felt that the 8Gb held me back.
But I kept going back to the idea that if I keep this computer for even 3 years, the $200 becomes insignificant (to me at least, I recognize I am very fortunate). So I couldn't really identify a good reason to upgrade to 16Gb, but because I decided to do it anyway because for $200, it was worth future proofing it. So I ended up returning my base model 13 inch macbook pro and upgrading it to a 1Tb SSD, with 16Gb of RAM. It is now my daily driver computer. Even fully loaded it is still a fraction of the cost of my old macbook pro. I couldn't be more happy with my computer right now.
The performance is just incredible. No fan noise ever. Epic length battery life. Perfect size. I just really love this thing.
So do you need 16Gb of RAM. No. Not at all. I have not yet identified a time when the 16Gb has helped me or made a noticable difference. When I had the 8Gb, I never felt like it was slowing me down. But with all that being said, if your budget allows for $200 extra, I would get it just to future proof your purchase. But if you are already penny pinching, then don't worry about the 8gb. You probably won't ever notice it holding you back.
I'm holding out for the next gen to release for my personal machine and will go with 16GB and whatever the next CPU is. Mostly, as you suggest future proofing, but there are a few spots in my workflow where it does hang a bit which I think extra memory would help with.
Until now, my laptop would be plugged in per default and every now and then I would run on battery. Where as now, my laptop needs to charge now and then, but most of the time it runs on battery.
Now I almost never use my M1 laptop on wall power. I use it on battery power all day long, even when sitting right next to a power outlet. I charge it every few days when I go to bed or won't be working on my computer for a while. This is similar to how you use tablets and phones. You usually charge them up and always use them on battery power. Only in an emergency do you use it while plugged in. The laptop now actually fits into that category now and is used like a true go-anywhere laptop, not a portable computer.
Battery life was still better than my i7 2015 mbp
Suprisingly I have no problem with docker. I just download the docker preview and it works flawlessly. One minior issue is that if I build a Docker image that support multi arch, then push to docker hub, then that image is arm64 by default. I have to do `docker build --platform amd64`.
I document that process here: https://axcoto.com/notes/2021-03-13-docker-apple-m-nginx-and... I think that's the only gotcha I got so far.
Haven't been able to run a php 5.3 container yet though for this one project that is pretty much on life support.
No, it's not. Perhaps that's an old wives tale from the era (2-3 years ago) when it had bad fs performance and didn't use the native hypervisor directly?
But then, M1 MBP is 25W part and not 180W, it is also silent, unlike the TR. So pick your poison.
I don't know about "Vastly", but it is better and will likely always be better because of the structure of Docker. Docker is by definition, a container that runs atop Linux. Since Linux is already Linux and the Mac has to run Linux in a hypervisor, bare metal Linux is almost always going to be faster.
But, Docker is just a part of the workflow. Dealing with the limits of the Linux Desktop to get better Docker isn't worth it a lot of the time.
That's just your personal preference; I'm using all three (macOS/Linux/Windows 10) and all three are fine for desktop.
At that point if you want to bind mount in a container you're talking about macOS binaries running inside the container, which means a full macOS docker architecture port (like they did for Windows, which AFAICT didn't make them much if any money, but I think M$ paid for it anyway).
A ‘native’ container would be running the MacOS kernel. You could run MacOS software in it, but it would be incompatible with Linux docker images.
If I don’t care about persistence of my containers (e.g. I’m just running ephemeral tests), is there a way to disable Docker for Mac / Virtualization.framework’s cache-flushing behaviour entirely? I.e. to get the same behaviour as mounting Linux ext4 with -o nobarrier,data=writeback?
Does Virtualization.framework maybe have first-class support for swap volumes — i.e. inherently ephemeral volumes, that don’t need to be flushed to the host?
For many developers Docker alone has a huge cost of entry in terms of learning. If you also ask them to pay for something which many dread to learn then even less people will adopt a technology which is actually one of the best innovations in software delivery from the last decade.
In the end it is just a bunch of APIs to abstract OS APIs, which end up being the minimum common denominator, as each OS offers different container capabilities.
Indeed. On Fedora Docker has already been replaced by rootless Podman containers, which are great for development. I wouldn't be surprised if Podman will take over on Linux workstations pretty quickly.
Edit: From testing by spinning up 10 MySQL servers, sure looks to be the case. Each runtime allocated approx 215 MiB of memory, which is what the available system memory was reduced by for each. The container image itself was approx 400 MiB.
We use containers inc. a MySQL container and accessing it is incredibly slow, with a request taking 5-10seconds that's instant on the production server.
I've heard that Docker Sync can improve this, is it worth a try?
If you're using a VPN (in my case, the NextDNS client), you might want to de-select the option to start Docker on boot. Start it manually instead once your VPN client is loaded and connected. In my case a failure to do this would completely bork the ability to connect to the internet - either over ethernet or WiFi. Took me a while to figure out what the cause was.
Technical limitations aside, from a security perspective it is not a good idea to run servers on the same system that you write code from. I humbly suggest taking the time to push code to your dedicated Linux server, otherwise you might inadvertantly be putting your company out of compliance by exposing your dev system on any given network.
If you were to create a Linux VM to replace Docker, you would need it to also recreate the Docker build tools for that VM so you could recreate that VM on the server. At that point, you’ve more or less come full circle and essentially recreated Docker.
I have a Linux system (the VM). Docker is installed on that Linux system and I do all docker related work on the Linux system.
Makes a ton of sense. It’s been a while since I used Docker, but I’ll have to try it out next time I’m using a container setup. Particularly since HyperKit seems to make running a VM so straight forward.
Really hoping those days are behind me with this, it made me feel a bit foolish for springing for the mini as quickly as I did.
Edit: Nope, segfault yet again. God damn, well you get what you pay for!
Intel -- instant. Hope they fixed it!