130 points · by ingve · 6y ago · 161 comments
Buy the M1 and switch to a fully remote development experience. Spin up a DO instance, wire up VSCode Remote, and run docker on that machine.
While it does require an internet connection, I’ve found remote development to be really fantastic as an option on a personal “underpowered” laptop. Especially if you are running a cluster of services or large databases, I find it’s far more productive to offload the running of my code to a VM in the cloud.
I get that remote development is a thing some people prefer, and if you have an underpowered machine it can be great to just use it as a thin-client and get all the power and performance you need without running down your battery or spending a fortune on local hardware.
BUT... you're recommending this as a workaround for limitations in expensive "Pro" local development machines, as part of an encouragement to go ahead and buy them.
Why not follow your advice and buy an old refurbed Macbook. Or any 2nd-hand machine of any brand. Or a low-end Chromebook.
To clarify: I'm not saying remote dev is bad, or you shouldn't recommend it. It's just really really weird to do so in this specific context.
It shocks me that so many people want to run Docker on a platform it was never built for. The suggestion above is not bizzare, it's a normal use case: run Docker on Linux like it's meant to be run.
Docker for Mac has had performance issues for years, especially related to file I/O. The common suggestion is to use NFS to get around those, which is just ridiculous when you think about it. [0]
[0] https://vivait.co.uk/labs/docker-for-mac-performance-using-n...
surely you can imagine a situation in which a developer prefers to develop on a mac but wants to deploy to a linux server though? that's the use case here.
Yet, it works, and well, your shock notwithstanding.
If your goal is a SINGLE portable, virtualized platform for your developers, which does not require a persistent internet/SSH connection, and which is "fast enough" for developers to be effective, Docker on Mac is a pretty swell solution.
You can dismiss this but if your dev shop is doing dev work that lands in a k8s cluster, it sure is nice to just have devs install docker desktop for Mac and they have a fully functioning k8s cluster that just works.
My whole company uses macs except me. I had to spend a bunch of time figuring out how to get a dev environment working on Linux. And it wasn’t easy as none of the out of the box k8s solutions support how we developed our build system. If I wasn’t a k8s admin from early versions of k8s I would have just given up.
No platform is perfect.
Yeah, I came to say the same thing - if you are anyway going to do remote dev, why still bother buying a new Apple device?? Anything else will do fine too!
My desktop is an AMD Threadripper 299WX running FreeBSD. My laptop is a mid-2014 MBP. I can build a kernel about 8x faster on the AMD than in a VM on the mac. So when I'm away from my desk, I use the MBP to ssh to the AMD and do all my dev there.
My biggest problem with my current MBP is that the battery life is down to 1-2 hours. Less if I have a video call.
I could maybe just use a chromebook or windows laptop, but the Mac "just works" for all kinds of corporate stuff and is the path of least resistance.
For me it'd be because of the User Interface.
I'm not disagreeing with you per se. Simply pointing out there are other considerations when selecting hardward.
I agree with that in principle, but in practice Docker development on Intel MacOS already performs so poorly that it’s effectively broken anyway. I’ve actually been looking forward to Apple Silicon in the hopes that Docker starts over again and gets things working without the constant CPU pegging and 5-10x performance penalty.
I don't use Docker on Mac, but I'm curious how much of the performance penalty is attributable to VirtualBox. I use a VirtualBox-based Vagrant environment, and the performance is awful. It mostly comes down to terrible disk performance due to how VBox shares directories from inside the VM to the host filesystem. Apparently it can be fixed entirely by switching to local NFS, but I haven't had any success getting that working.
So, if I like all those things, but I can’t build a docker image locally (for now), why not just do something that will potentially improve my development experience in addition to allowing me to use this machine?
I mean, folks should do what they want. But, I’d say calling this recommendation bizarre to be a bit over the top :)
I personally would wait until Docker works, if that was a problem for me.
I totally believe that, but the question is, how good of an option is it for a powerful, expensive laptop.
One of the great things about docker is/was that one can develop locally and the same thing would run when deployed. Having to run it on a distant machine kind of ruins this.
That's great, if you're doing something that will fit in a laptop. But I think the OP's point was that people using large datasets, complex workflows, or multiple projects, his method makes sense and saves money on buying new hardware.
For example, the web site I'm going to putz with today is many GB larger than the unformatted capacity of my laptop's SSD.
One could argue that even the "cheapest M1 + paying your remote Docker/Compute friendly machine" is not really the cheapest option. At least do not convince yourself "the new M1 chip is faster and will improve my developer experience regarding compute"
I couldn’t figure out how best to fit VSCode though. It works remote, and with docker, but it seems very tricky with both?
e.g running a ruby linter inside docker on a remote box and seeing lint errors on my local VSCode.
Any pointers or tips?
But you get the compatibility and still keep the Air’s absurd battery life, so it wouldn’t necessarily be a bad setup.
Especially if you buy M1 hardware to take advantage of the machine learning enhancements.
You could buy a chrome book for less than Apple silicon and do remote development.
To me it feels more like going back to the way things used to be. Reminds me of when I used to do my work by pushing buttons on a Wang terminal in one state, and the PR1MEOS machine that I was actually working on was several hundred miles away.
Maybe as our work becomes more complex, it makes sense to return to thin clients.
The kicker is who owns the super computer you're dialing into, and how much of it you actually own. "Back in the day" it probably made sense for a company to maintain their own servers.
But now it's too profitable to not use amazon in most cases. It's nice not needing a server room, but hat suffers is ownership issues with infra and data, accepting the outages, and rolling with the crazy decisions amazon might make in the future that will effect your systems.
On the other hand, I'm worried it's going to be used to (attempt to) "take away" our ability to compile locally rather than giving us an amazing, immutable, local dev environment.
It's how I work now, a lot of vs code remote and ci/cd anyway.
That being said I am ordering my M1 air .. for reasons, definitely just lusting for a new upgrade.
There was a recent discussion on Hacker News about the use of abbreviations and acronyms and how they drastically reduce the legibility of posts.
But yes 100% agreed, especially this one as it's really hard to google for..
- Is there a way to forward local ports to the remote docker instance? So I can access the app on "localhost:3000" as usual? (OAuth setups make the app URL a pain to change)
- Is there a way to "mount" local volumes on the docker instance? (Reaction Commerce mounts the code folder as a volume. Altough that project has other issues, that's the main thing that kept me from using it).
Mounts: it's equivalent to mounting a remote file system. Docker -> server -> local.
https://www.lenovo.com/us/en/desktops-and-all-in-ones/thinkc...
If anyone has some good tips for this, I would greatly appreciate it.
Been without a personal laptop for close to a year now, mostly using my work laptop or personal desktop... and have been considering the M1, but likely won't pull the trigger without better Docker support. I've found WSL2+Docker support to be excellent and hope to see similar levels of integration with OSX before too long.
Using the CLI to connect to a VM isn't so bad, did this a lot before Docker Desktop was even a thing, though I generally just ran an SSH shelled into the VM full time. With VS Code's remote extension, it's roughly the same either way.
Realistically, most people that have docker in their life are going to not be bothering with ARM macs for quite some time. In any case, the 16GB limit is also not great if you are using docker, some ide, and other tools. I'd be looking for something closer to 64GB if I was buying currently. Maybe the second generation will be a bit more attractive and maybe by then the software ecosystem will have matured a bit. Right now basically everything I use on a daily basis is somewhat problematic.
so it doesn't seem a huge leap to imagine the reverse being possible before too long
(I kind of hoped it already was, but I guess the existence of blog posts like this and the one from Docker here https://www.docker.com/blog/apple-silicon-m1-chips-and-docke... indicates there's work to be done on the Docker for Mac app itself to get it working nicely)
"It's us that need to fix it, not Apple, so we expect it to work on the current M1 chips."
Docker isn’t going to be doing that, at least they’re not going to work on it themselves.
It unfortunately prevents me from using Docker for local development. I'm hoping things change with M1.
That works - but it pegs processor usage on the M1 mac...
Run a real Linux under VMware fusion or rent a remote $5 Linux and set up Docker and other stuff there.
Simplicity is king in local dev.
https://twitter.com/justincormack/status/1331965304273047553
A lot of the official base images on Docker Hub are dual architecture now (both x86-64 and arm64), so if devs on M1 can build arm64 images locally from those, develop on those, and then have CI build the production x86 image, things should be more or less fine.
Of course, I'm sure a lot of people rely on 3rd party base images that are still just x86-64. So I expect there's going to be a pretty painful transition period where Docker works on M1 Macs but a lot of popular images don't.
Or maybe Docker's official response will be a Docker for Mac release that still runs x86 in a qemu VM or something, and arm64 Docker on M1 Macs will remain an oddity for a while. But I hope they lean into improving tooling for dual-architecture support, because I think we're increasingly moving into a dual architecture world, and not just because of the M1: as ARM becomes more popular in production, I'm sure more people are going to also find themselves in the opposite situation with x86 workstations & arm64 production servers.
That's not really the point. Cross-compilation is no problem these days, especially for targets like x86-64. The point is rather that devs will be running the code locally in a completely different environment to production which defeats the purpose of using Docker for development.
Most people quietly switched to docker-compose templates shared through private repos within a month for quick local runs and then tested end-to-end in dev cluster when it was mature enough.
What I'm saying here is that architecture mismatch is really just another variable, and purpose of docker locally nowadays is not to replicate prod. That is unachievable and the sooner one accepts it the better. Still it's the best way so far to keep DLL hell at bay.
I expect that the official M1-supporting Docker Desktop will eventually, given a dual-arch image, allow you to choose which architecture to use. (One would run natively, the other under emulation)
There are situations where I'd use this feature, but 90% of the time I'd be fine using arm images locally and deploying x64.
(I could also imagine this working the other way -- an x86 dev machine and an arm deployment target -- which I think to some degree is supported by Docker today)
As Java/.NET dev having heterogeneity between environments was never an issue.
"I can't run Arm in the cloud because I haven't got an Arm development machine"
You have to break into the vicious circle somewhere :)
You just prolong the agony. Saving the planet means we all go back to middle ages, the rest is feel good wishful thinking.
World War III won’t be a fight over “values” but rather a constant fight over who controls water, energy, and clean air.
There are routes forward, but they require global coordination and creativity. It's hard to imagine because there's no historical precedent, but I think it's worth trying for, and I'm confident it's at least _possible_ we can succeed in transitioning to full sustainability.
https://finestructure.co/blog/2020/11/27/running-docker-on-a...
Switching arch should be less painful when depending on the OS facilities.
I've known about Xhyve and other lesser-known virtualization systems for macOS, and now I know about vftool, so that's a good thing.
Interesting how easy it is to make a VMM using Virtualization.framework.
Adding the same interface to other operating systems would require extensive changes to their kernel. In the closed-source macOS that is not feasible. Apple doesn't give that level of access to anyone.
Pretty much the answer to any "Why can't X do Y for $0" type question.
https://github.com/docker/machine
Even though it's all a VM under the hood, docker-machine makes it all feel a bit more streamlined/native. Also, the version of Linux it uses—Boot2Docker—will likely start up more quickly, and probably use slightly fewer resources as well.
I'm using docker-machine so I can run Docker on OS X 10.9, which predates Docker Desktop (and Hyperkit).
If you haven't seen it yet, we can now go one step further with the UX with Dave Scott's port of Docker Desktop - https://twitter.com/mugofsoup/status/1332382741892124675?s=1...
1. Windows 10 via Bootcamp boot faster than macOS — on an Apple machine.
2. What’s wrong with a tiling manager? Why I need a third-party app to organise windows?
3. I saw in another HN post that an Apple engineer was patting themselves on the back for the memory mama garment. Then, why the hell at login macOS uses more RAM than Windows?
4. I can’t use Docker for Mac. The same dev environment with Docker and WSL2 on Windows 10 via Bootcamp works fine. I mean, it still sucks because of the limited RAM, but it’s fine. On macOS it’s way slower, and the fans go crazy.
The hardware — except for the keyboard and the Touch Bar - is fine. The touchpad is great, the screen is fantastic. But Apple needs to work on the operating system; just don’t touch the shortcuts. Those are fine.
The latter is closed source, proprietary, and silently uploads a ton of information about your local system to Docker Inc if it should crash (which is easy to trigger accidentally), including pcap logs of your local network, and a list of all running programs on your system, among other massively intrusive things.
Docker Desktop is a privacy nightmare. Always opt for the command line open source docker, and either set DOCKER_HOST="ssh://remote.example.com" in your environment to do remote builds, or run a local VM like this article suggests.
I keep looking for a better solution but this works the best.