10 ms·
Apple Silicon M1 Chips and Docker
- cosmotic 6y agoThis doesn't really clear up any of the questions I have. Will docker running on ARM run docker containers from images built for x86? Will docker running on ARM be able to build images for x86?
- dwaite 6y agoThrough QEMU
- mistercorea 6y agoisnt that linux specific?
- yjftsjthsd-h 6y agoNo, although the KVM acceleration is (but there are others; I've used HAXM on NetBSD). EDIT: Just realized that you probably meant for binary compatibility. That also is not Linux-only, but https://qemu.readthedocs.io/en/latest/user/main.html#supported-operating-systems https://qemu.readthedocs.io/en/latest/user/main.html#support... only talks about Linux and BSD, with no mention of Darwin.
- deleted 6y ago[deleted]
- userbinator 6y agoI wonder how long it will be until the Hackintosh community manages to boot macOS on a fully emulated ARM hardware. There are already attempts in progress: https://news.ycombinator.com/item?id=25064593 https://news.ycombinator.com/item?id=25064593
- mistercorea 6y agoRight. if it is building it's own linux kernel and build container it defeats the purpose of having a docker....
- yjftsjthsd-h 6y agoRunning docker containers on Darwin already required you to run a Linux kernel, though?
- mistercorea 6y agoYes but this was possible through virtual machine(virtualbox)
- gilgoomesh 6y agoThey mention using Apple's Hypervisor Framework. On Apple Silicon, this runs ARM64 programs only (Rosetta 2 is unavailable to programs running inside Apple's Hypervisor Framework). https://developer.apple.com/documentation/apple_silicon/about_the_rosetta_translation_environment https://developer.apple.com/documentation/apple_silicon/abou... Unless they plan to run an emulator inside the Hypervisor Framework (a seemingly unnecessary effort since you could run the emulator without Hypervisor) this implies x86 containers will not work.
- lights0123 6y agoDocker for Mac already can build and run cross-arch containers: https://docs.docker.com/docker-for-mac/multi-arch/ https://docs.docker.com/docker-for-mac/multi-arch/ And if you're on x86, you can run ARM containers with QEMU userspace emulation seamlessly after running docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64 The inverse would be extremely easy as well.
- gilgoomesh 6y agoHmm. I would guess then that Docker would be aiming for both emulation and hypervisor. Seems reasonable.
- viraptor 6y agoSeamlessly, but with a heavy performance impact. In my experience it's not really usable in anything other than running specific single tests, or some short demos.
- johnklos 6y agoAnswer your own question: Can Docker on ARM run x86? Can Docker on x86 run ARM? If not, then why expect Apple ARM to run x86?
- afandian 6y agoApple ARM can run x86 under Rosetta 2. The question is whether that can happen under Docker.
- olliej 6y agoIt runs user space x86 under arm, and those are all well formed programs that the os understands. Rosetta is a translator - to run a vm in a different architecture requires an emulator.
- DarmokJalad1701 6y ago> Can Docker on x86 run ARM Yes. There are ways to set up Docker to seamlessly run arm containers on x86 using CPU emulation.
- raverbashing 6y agoThe question is: why even care? Use an Arm image. For docker, it makes little to no difference
- mistercorea 6y agothat mean you need to have an arm based server for deployment of your code / services.
- yjftsjthsd-h 6y agoThat requires that ARM images are available, which will take time and always have a disconnect. It also violates the idea of being able to run the exact same image on your laptop (ARM Mac) and in prod (x86 server).
- jrockway 6y agoYou can run on ARM servers in production. They're even cheaper than x86 servers. (Though also slower, at least AWS's version.) Realistically, ARM is probably the future, and just needs something to push society in the direction of the future. A lot of people use Macs, so this forces people to become interested in switching, which has some value. Remember when the original iMac had USB instead of ADB ports? Everyone was mad about it. But USB was the future -- you can plug that iMac's mouse into pretty much any computer you have and it still works. (I've been wanting an ARM desktop for a while, but it seems there is trouble standardizing something like BIOS/UEFI, and the CPUs you can buy are more expensive and slower than x86 alternatives. I'm also not sure if anyone ever decided what the standard "ARM" configuration looks like... binary calling conventions, endianness, supported instructions? But, if Apple can make a competitive ARM chip, so can others, and the standards will follow. We'll see!)
- vbezhenar 6y ago> You can run on ARM servers in production. They're even cheaper than x86 servers. (Though also slower, at least AWS's version.) Where can I buy ARM server comparable with x86 server on performance? I'm not interested with clouds, I want bare metal server. I'm not aware of any server brand like HP or Dell producing ARM servers. I'm also not aware of any CPU manufacturer producing computer desktops with ARM comparable with x86, outside of Apple macs. I'm not convinced that ARM is the future. For me the future is both architectures co-existing.
- olliej 6y agoNo. That's what they said: you will build for your deployment architecture, just as you would today with the arm aws systems. The virtualization is that: virtualization. It isn't emulation for that you need Qemu or similar.
- deleted 6y ago[deleted]
- joemaller1 6y agoIf Docker can run on Raspberry Pi's ARM chips, it can run on Mac ARM chips. I expect we'll see this working very soon after the new Macs start to arrive.
- mistercorea 6y agobut you cant run x86 containers... https://blog.alexellis.io/5-things-docker-rpi/ https://blog.alexellis.io/5-things-docker-rpi/
- lights0123 6y agoBy default, but one sudo apt install qemu-user-static # or docker run --rm --privileged aptman/qus -s -- -p # (every reboot) away and you can. It'll be slow, but it'll work.
- afandian 6y agoDocker is architecture specific though. The meaningful question is whether it can run the same docker images as it did on the previous Mac hardware or not.
- paxys 6y agoDocker uses Linux-specific containerization technology, so getting it to run on MacOS and Windows is a completely different beast of a problem.
- happymellon 6y agoDocker runs in a Linux VM if you use Windows or Mac,and nothing will change that here. The "different beast" is just some go wrappers.
- lsllc 6y agoSounds a bit like Docker is at a loss. Caught between a closed source OS (rock) and an architecture change (hard place). Ideally, they could leverage Rosetta2 to run x64 containers under macOS on Apple Silicon ... but I guess Apple isn't playing ball (because otherwise they would have probably announced it at WWDC). At this point I see an Apple Silicon based Mac is just a consumer device, I don't think I'm going to be able to use it in anger for development work at the moment (other than for Mac consumer apps). Not really sure what Apple have to lose here ... but if Macs with Apple Silicon are not a viable dev platform for "mainstream" containers, then that's going to drive developers to Linux (or Windows).
- afandian 6y agoThere's an ironic parallel in Docker referring to software as "content".
- tasogare 6y agoWait until parents refer their childs as DLC.
- easton 6y agoI think Apple didn’t want to support x86 emulation at all, and made Rosetta 2 purely AOT compilation (which you can’t really do with virtual machines). It makes it so they don’t have to deal with having x86 VMs available but super slow making people think that Apple Silicon is slow (even if that’s untrue), and that’s kind of the growing pain that Microsoft is going through at the moment with Windows on ARM.
- anyfoo 6y agoRosetta 2 purely AOT? Where did you get that idea from?
- jagger27 6y agoIt certainly still does some JIT/interpretation at runtime but it does indeed translate the executable upon first launch.^1 I can’t imagine how it would be able to fully translate a browser JavaScript engine that’s doing its own JIT, for example. 1: https://www.macrumors.com/2020/11/12/rosetta-2-translation-can-take-20-seconds/ https://www.macrumors.com/2020/11/12/rosetta-2-translation-c...
- offtop5 6y agoCan we give them a full month to sort this out ? I want x64 docker on Arm , as this could also be massive for server power consumption. But things take time . If your some wiz kid who can crack this puzzle you’ll have a billion dollar startup within 6 months As someone who’s published on the App Store , having a single binary run on IPhone , IPad and Mac is a much much bigger deal than most of you realize .
- crb002 6y agoI don't want x86 Docker on ARM.
- coding123 6y ago... so what, so no one else should be allowed to want it?
- vbezhenar 6y agoWhat the point of docker if you can't just run single binary everywhere? That was its promise, right?
- tristanstcyr 6y agoI don't think that doing so across architectures is a major goal.
- silly-silly 6y agoYou're confusing docker with java.
- umvi 6y agoThe point of docker is to bundle all the dependencies of a given application into a single place. That way you don't have "works on my machine" problems, because both prod and dev are clean virtualized identical systems (containers)
- happymellon 6y agoNo it wasn't, you are thinking of Java. Docker was snapshots of developer machines you can run in production. They never promised that it would run everywhere.
- hartator 6y agoHow many screw ups are we going to give Docker? It has been since July that you can have developer kits for Apple Silicon. This should not have been a surprise.
- tln 6y agoI don't think this counts. The developer transition kit machines didn't support virtualization, aiui.
- speg 6y agoGosh, it never occurred to me that the reason the UI was so bloated and slow was because it is using electron! Why couldn’t they just write a quick set of native panels and call it a day? Sigh.
- paxys 6y agoI use Docker for Mac every day and didn't even know there was a GUI.
- Eric_WVGG 6y agoSigh. It was the first thing that occurred to me.
- mistercorea 6y agodidnt they said they have faster browser rendering speed on M1?
- justinsaccount 6y agoMaybe building containers for one operating system and architecture from a completely different operating system and architecture is not the best idea.
- paxys 6y agoHow do you think people write and compile software for any embedded or other low-powered architecture out there? The vast majority of hardware in use around the world today isn't desktop class, and emulation works just fine for building on those.
- tonyarkles 6y agoCross compilers are nowhere near the same as Docker on ARM Mac building x86 Linux containers. The biggest difference: no one expects you to be able to run your MIPS binary on the machine you built it on. Edit: although sometimes you can through qemu.
- hebetude 6y agoDeveloper transition kit has been around for a while. Docker just found out they needed to buy those?
- trixie_ 6y agoIs this the beginning of application compatibility issues with M1?
- Shank 6y agoThe really perplexing thing to me here is that Docker Desktop...was featured on stage at the Apple event. How? Did Apple just hack it together and get it working? Was it just fake? Was Docker involved at all? I feel like it was implied that Apple was doing the hard work here, but now it looks more like nobody was doing the work, and showing it off working was a hat trick?
- paxys 6y agoFYI "hat trick" has an entirely different meaning
- moondev 6y agohttps://i.imgur.com/bQb1grM.png https://i.imgur.com/bQb1grM.png Makes you wonder what else was "simulated" during the demo?
- kristianp 6y agoFrom that image, the docker server could have been running in a Linux VM, and docker desktop connecting to that. EDIT: change "was" to "could have been".
- moondev 6y ago> docker desktop connecting to that Docker's blog post says "Docker for Mac (silicon)" dependencies are not working yet. Apple gave the demo 3 months ago.
- pilif 6y agothe UI probably ran in emulated intel mode. That part can totally be dealt with by Rosetta 2 - only the VMs need special support.
- deleted 6y ago[deleted]
- coding123 6y agoI think there are two questions I have: Will I be able to build/run x86 (64bit) docker containers? Will I be able to build/run ARM containers (and without "switching" something)?
- moondev 6y agoApple's "demo" showed Docker for mac running, complete with containers. https://i.imgur.com/bQb1grM.png https://i.imgur.com/bQb1grM.png Docker here is saying their "for mac" application dependencies are not even all working yet. Unless I am missing something - Apple's Docker on silicon demo was fabricated?
- jjcm 6y agoDocker is likely saying that it doesn’t natively run on ARM yet. Apple’s demo was likely using Rosetta. That said this is all speculation at this point. We’ll know tomorrow.
- moondev 6y agoA Linux virtual machine is required to run Docker on macOS. Linux containers need a Linux kernel to function.
- ytch 6y agoDocker on Mac needs hypervisor, but Apple says Rosetta 2 doesn't support x86 hypervisor [1]. Therefore it is not possible right now. [1] https://developer.apple.com/documentation/apple_silicon/about_the_rosetta_translation_environment https://developer.apple.com/documentation/apple_silicon/abou...
- paxys 6y agoThat screenshot shows a full Linux VM running on the machine using Parallels. That VM then has Docker running inside it. Docker for Mac isn't involved at all.
- digianarchist 6y agoDoes docker-machine work? That’s what I’ve been using on my Ryzentosh.
- paxys 6y agoHere's how I expect things to go with Docker on Apple Silicon: - Rosetta 2 will not be involved at all - They will recompile the CLI, daemon and other parts of Docker Desktop natively for arm64 (but this has a dependency on the Go toolchain) - There will likely be a bunch of bugs or general inconsistencies in the new Mac Hypervisor (their dev hardware didn't even support virtualization), so it's unlikely that Docker's Hyperkit will just work out of the box on M1 - The above will take till mid-2021 at the earliest, but should hopefully release along with more "pro" Mac hardware - Once it is ready, you should be able to cross-compile and run x86_64 containers on new Macs, considering Docker Desktop will still automatically use QEMU to do the emulation. I expect running native arm64 containers will still be better though. TL;DR - don't buy the current lineup of Apple Silicon machines just yet for serious Docker work. Disclaimer: These are all just guesses
- sjtindell 6y agoYour mention of “pro” makes me wonder - isn’t one of Apple’s big pushes to sell to professional designers, photographers, etc.? Don’t they realize that some huge percentage of engineers and tech workers use their macs? That’s a whole segment that quite literally builds and runs all the platforms where macs are advertised or talked about...where is the “pro” MacBook targeted at that segment? With advanced virtualization, strong dev tools, whatever. You would buy so much loyalty and word of mouth from people who set the standard for technology. Heck, who actually write the standards of technology.
- tpetry 6y agoThey are aware of it, thats the reason why the 15 inch macbook pro for example does not have apple silicon yet. They released the consumer hardware now so everyone has 1 year to port their tools to apple silicon until the bigger (more professionell) machines arrive.
- jurip 6y agoThe showed Xcode multiple times during the M1 Mac release event and boasted about compile times so yeah, I'm pretty certain they do realize it.
- deleted 6y ago[deleted]
- thamer 6y agoBoth Electron and Go were referenced in the article but without links, so I went looking for them to understand how far along this work was. From the pages linked below it seems like with virtualization is the real challenge. Here is a post saying that the latest beta release of Electron supports Apple Silicon: https://www.electronjs.org/blog/apple-silicon https://www.electronjs.org/blog/apple-silicon And the GitHub issue tracking Go on AS, which mentions that support is coming in version 1.16 scheduled for release on Feb 1st 2021: https://github.com/golang/go/issues/38485 https://github.com/golang/go/issues/38485
- iends 6y agoYou don't need to wait for Go version 1.16, you can use gotip and compile for AS right now. Electron 11 was released today and supports AS, but it is listed as experimental. Would love to see an experimental docker for mac soon.
- fulafel 6y agoThe virtualization apps for mac/win seem to be a big distraction for them and muddy their product image. Trying to hide ISA differences in the next version would be a logical continuation of this track of course... Maybe they should pivot to the WebAssembly direction thay the founder was talking about before.
- neurostimulant 6y ago> Along with this, we have technical dependencies upstream of us that need to make changes prior to making a new version of Docker Desktop GA. We rely on things like Go for the backend of Docker Desktop and Electron for the Docker Dashboard to view your Desktop content. We know these projects are hard at work getting ready for M1 chips, and we are watching them closely. The only time I used docker mac ui is to change some docker machine config. If electron is a blocker then I think they can release the beta version without the ui and their users will hardly notice.
- Traubenfuchs 6y agoApple messed up by not engaging and assissting relevant software vendors with this change in time...
- jaChEWAg 6y agoGiven there is a bunch of software that is still incompatible to run on the new chip, what are all the benchmarks actually testing? I'm not disregarding the fact that the chip is fast but I'm just curious
- maxekman 6y agoI would not be surprised if we will soon see a pretty big shift towards ARM on the server/cloud side as well.