22 ms·
Docker for Mac M1 RC
- nicoburns 6y ago> Some container disk I/O is much slower than expected. See docker/for-mac#5389. Disk flushes are particularly slow due to the need to guarantee data is written to stable storage on the host. 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.
- pella 6y agoOuch ... ~10x slower ???? https://github.com/docker/for-mac/issues/5389 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."
- londons_explore 6y agoSince a lot of use of docker on a desktop machine has no requirement for data resiliency (web dev work where all containers can easily be wiped and rebuilt), it would be good to have a flag for "no flush" which just ignores all flush requests.
- hashkb 6y agoYou still want e.g. incremental rebuilds and file watching for tests and all that. It's really sad to hear this hasn't been addressed in years. Development with Compose on Linux is such a pleasure.
- londons_explore 6y agoYou can still have all that - flushing behaviour only affects things if the host machine suddenly kernel panics or loses power. For a laptop with battery backup that's probably a once a year occasion. In that case, I'd be happy to wait a few minutes for some docker stuff to be rebuilt.
- hashkb 6y agoYou can't, when you're on a Mac and your code is bind-mounted into the container. This is the most comfortable method of development for me, and works perfectly on Linux. https://github.com/docker/for-mac/issues/3677 https://github.com/docker/for-mac/issues/3677
- tommoor 6y agoYea, I think this is the same issue: https://news.ycombinator.com/item?id=26332732 https://news.ycombinator.com/item?id=26332732 Still an issue in the latest RC today
- Thomaschaaf 6y agoI don't understand why Docker Desktop e.g. Docker for Mac and Docker for Windows is available for free. I think it's a value added service and is executed beautifully and would be a fair way for the company to generate revenue.
- dustinmoris 6y agoBecause if you can't do `docker build` locally when learning or building software or studying IT then you will look for alternatives which allow you to achieve the final goal in a similar or "just good enough" way and then you will never start using Docker, not even in production. 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.
- Thomaschaaf 6y agoA lot of products e.g. CAD Software are available for free for personal/educational use or for a limited time. Alternatively I like the approach JetBrains (IntelliJ) are taking by providing the software for free or a reduced price: https://www.jetbrains.com/de-de/idea/buy/#discounts?billing=yearly https://www.jetbrains.com/de-de/idea/buy/#discounts?billing=...
- cies 6y agoThat not generally how developer infrastructure tools work these days.
- jpgvm 6y agoWithout it being free it would likely be replaced by a free alternative that would further limit Docker Inc from directly influencing their users now the core Docker daemon has been thoroughly commoditized.
- pjmlp 6y ago
- dustinmoris 6y agoThat's great news. I've been using the Preview with M1 support for a while now and have had no issues so far.
- darkteflon 6y agoI ran into [this](https://github.com/docker/for-mac/issues/5208 https://github.com/docker/for-mac/issues/5208) bug just today - mentioned in the release notes. 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.
- Zealotux 6y agoCurious on how Docker runs on M1, it's well known for being an horrendously slow piece of software on Apple computers, draining battery life like crazy. Any feedback on M1 Docker so far?
- cies 6y agoNeeding to use Docker is a great reason Linux on the developer laptop makes total sense. > 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?
- adamors 6y agoThe problem with Linux on the Desktop is that it's still a horrible, time-wasting experience. 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.
- noir_lord 6y ago> The problem with Linux on the Desktop is that it's still a horrible, time-wasting experience. 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.
- adamors 6y agoI'm well aware my experience is not uniformly true. 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.
- qeternity 6y agoWe switched over to Garden a year ago from a local docker-compose setup for dev. Garden has definitely had its rough spots but it works most of the time and it’s pretty amazing when it does. 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.
- 0x008 6y agoHow is Garden different than using docker-cli with some random container runtime other than docker?
- ths 6y ago(Garden co-founder here) 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).
- darkwater 6y agoWe already have some home-grown kubernetes dev environment in which every developer/QA can spin up all of our services in a dedicated namespace, but it's a bit tedious and spaghetti-code as it grew organically over time (from a 15 devs team to a +70 one). Garden looks like a nice alternative solution, do you think Garden Core is enough to get started? (we like to get our hands dirty)
- ths 6y agoSounds like Garden Core could be a great fit here. 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.
- me551ah 6y agoI wish Apple would give Docker some love like Microsoft does. Using Docker with WSL is a breeze, and it runs so much better than MacOS. And as an advantage you get access to Linux package managers which are so much better than brew. Brew is good, but Linux package managers like pacman and apt are so much better. Having a proper Linux distribution open in one window while I play 'Call of Duty' in another, is one reason why I've moved to Windows again.
- countmora 6y agoWhere do you see the limitations of Brew? Despite it being a little wonky on beta releases of a new macOS iteration it works fine for me.
- dastx 6y agoLast time I used a Mac was around, maybe 3 years ago, so this certainly may have improved. 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.
- vkoskiv 6y agoStill quite slow. As far as I know, it's just a big heap of small ruby scripts that invoke each other, and ruby isn't known for blazing-fast performance. It also uses git internally, and quite heavily, so that probably adds some overhead as well.
- vkoskiv 6y agoI think the main criticism of homebrew is that it's really slow.
- tokamak-teapot 6y agoSlow where? Searching could be faster, but it’s a few seconds. Installing is fast except where compilation happens. I have to admit I don’t know why it compiles when it does, but it isn’t all packages that get compiled.
- sneak 6y agoAt some point, Docker switched from being an open source, free software company, to producing stuff like these Docker Desktop apps that are a) nonfree, b) not even source available, and c) contain spyware in them that report back to them your activities in the app silently and without your consent. (On crashes, it even uploads some of your network traffic in the form of pcaps.) Most people didn't notice this shift, as Docker Desktop (the app in TFA) still has a github repo, et c. It just doesn't have any source in it. 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).
- Accacin 6y agoHow do people use Docker on Mac? It's so slow for me I've started to use my X220 (Linux) as it's faster than my 2018 MBP. 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?
- deleted 6y ago[deleted]
- lowercased 6y agoI use docker on a mac, and... while I do feel it 'slow' in some sense, I've never seen 5-10 second access time to a mysql container. MBP 2019 here, but never saw that on MBP 2015 either. Is there some other mysql config that's trying to do some network lookup on the incoming connection? I vaguely recall that being an issue with mysql on bare metal servers years ago - if there was some specific network name as part of access control, the mysql would try to resolve the hostname, and that would sometimes be very slow, depending on external factors. (--skip-name-resolve and reverse DNS seemed to be things I'd found along the way, but I'm doing this from memory and it was 10+ years ago - haven't hit that issue in... a long time).
- Tepix 6y agoSo, i just got my Macbook Air M1 16GB a few days ago. What's the best way to run Linux on it in a VM? Is it Docker?
- jpeeler 6y agoDepends on what out of box experience you want and if you want a GUI. For an easy out of box experience, open source, GUI based tool I suggest checking out https://github.com/utmapp/UTM https://github.com/utmapp/UTM. There's also an app store version that supports the author I believe.
- fghorow 6y agoInteresting. Can UTM run Windows also? I have a few critical domain-specific commercial apps that are Windows only, and need that in a VM...
- bouk 6y agoI wish apple would support a couple extra kernel features (like bind mounts) so we can have native macOS 'containers' instead of this nonsense. Running MySQL by running qemu inside a Linux VM is just insane. Nix can fill some of the same roles, but it doesn't work on M1 yet
- sneak 6y agoWouldn't that also require full namespace support, not just "a couple extra kernel features"? 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).
- bouk 6y agoNamespaces are useful for security maybe, but for macOS the biggest reason to use containers is to have a controlled and reproducible way to run certain pieces of software. With chroot and bind mount you can already achieve that.
- mr_toad 6y ago> native macOS 'containers' instead of this nonsense. Running MySQL by running qemu inside a Linux VM is just insane. 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.
- neop1x 6y agoWouldn't some kind of "syscall proxy" or a wrapper possible? There is gVisor [1] which if I understand correctly re-implements Linux kernel in userspace for security, pretty interesting. Such layer would have to re-implement missing pieces in Mach kernel though so maybe it would not be as easy. [1] https://github.com/google/gvisor https://github.com/google/gvisor
- b1gtuna 6y agoI wish there was CLI-only version of the Docker Desktop. I can't even launch Docker Desktop unless there is a monitor connected and a user logged in.
- qbasic_forever 6y agoRun containerd and buildkit in a vagrant VM. You'll have a lot more control--you can pick what kernel you want (and even upgrade it as necessary), you can expose host filesystems and devices to the VM, etc. It's the same thing Docker Desktop is doing behind the scenes but now you control the full stack.
- chatmasta 6y agoI love Docker, but I gave up on using it on Mac. I put a lot of effort into fighting it, but ultimately, it seems some of the issues are just too fundamental. I like to call the Docker-for-Mac experience the MacBook Airplane. At some point, your fans will start spinning, your productivity will crash, and you'll spend the next three hours sifting through open GitHub issues from 2017 where everyone is still complaining about the same problems. 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.
- lupire 6y agoOn Windows Docker just crashes at startup, skipping the CPU/fan part.
- hu3 6y agoYou're joking right? At my previous job we had dozens of devs who worked with Windows WSL2 + Docker just fine. 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.
- e40 6y agoi have been using docker desktop on my trash can pro for a long time. No issues.
- giuscri 6y agoYou setup a virtual machine then?
- chatmasta 6y agoI use an actual remote machine (Scaleway in my case). VSCode remote does work with any VM or container though.
- pkilgore 6y agoFile access on preview7 was atrocious. It would take a seeded postgres-debian container 3 minutes to start (maybe 64 megs of data inside) if you kept the postgres volume on the local disk inside the container! Intel -- instant. Hope they fixed it!
- ryanSrich 6y agoI’ve been using the experimental version for a while now and haven’t run into any issues. Glad to see a release candidate.
- aasasd 6y agoI thought M1 is deprived of hardware support for virtualization? Wouldn't that botch dev workflows considerably?
- nhubbard 6y agoNo, I think it was the difference between Intel-derived virtualization and ARM-derived virtualization. Virtualization on ARM Macs still exists. Docker just had to convert their Intel-specific code to ARM-specific code.
- iends 6y agoThis was only on the dev kits, which were released without virtualization support.
- aasasd 6y agoGotcha, thanks.
- dev_tty01 6y agoNo, it is supported in hardware and MacOS has frameworks to support virtual machine implementation. https://developer.apple.com/documentation/virtualization https://developer.apple.com/documentation/virtualization
- derefr 6y ago> Some container disk I/O is much slower than expected. See docker/for-mac#5389. Disk flushes are particularly slow due to the need to guarantee data is written to stable storage on the host. This is an artifact of the new virtualization.framework in Big Sur. 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?
- mistyfud 6y agoI recently left the Mac ecosystem and bought myself a System 76 laptop. I do a lot of server-side development and running Docker at native speed is a big productivity boost for me. I really do hope they get this sorted out, it's a great technology that has measurably improved the local development experience. I wonder if services like https://garden.io/ 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?
- teflodollar 6y agoHow are you liking the System76?
- deergomoo 6y agoCan this version run the official MySQL images under QEMU? I had everything working on the last preview version except for MySQL; they would immediately crash with a Go error.
- TameAntelope 6y agoVery excited about this, been wrestling pretty hard with the previous release, it had lots of issues, to the point where I was SSHing into my old laptop to run builds. 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!
- sigjuice 6y agoDocker is for running Linux apps. I honestly don't see the appeal of abstracting away the Linux VM via Docker for Mac, especially if it has issues like filesystem performance. I have been running docker inside a Linux VM in VMWare Fusion on my Intel MacBook. Surely it would be possible to just have a plain Linux VM on an M1 Mac and run Docker inside it?
- ogre_codes 6y agoThe big thing Docker solves is repeatability and isolation. If you create a Docker instance on your Mac, you are more or less guaranteed it will work the same in production. 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.
- sigjuice 6y agoI am not creating a Linux VM to replace 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.
- sarabad2021 6y agoYes, this is really the only way to tolerate Docker on a Mac. Basically it's the same thing WSL does on Windows. Linux in a VM then you run Docker in the VM. Not many people talk about doing it this way though.
- ogre_codes 6y agoAh, obv I misunderstood your above post. 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.
- dumpsterdiver 6y agoI've never found it reasonable to virtualize on Apple systems. Apple optimizes for security, specificity, and bubblegum usability. 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.
- ngcc_hk 6y agoAmazing discussions here seems more on running wsl2 than mac