16 ms·
I 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
by me551ah 6y ago
I 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.
- varjag 6y agoWell, a few seconds for package search in a local index is slow. It's instantaneous with apt on my 3 year old Linux desktop, where here is the famous M1 advantage? :) Installing anything with brew involving multiple dependencies is also taking forever-ish, compared to mere seconds with apt.
- ratww 6y agoIt wants to update a few times a day by default when you call it, so running a simple brew install anything normally takes about 30 seconds (I'm in a MB Pro), even if it's just to say the package you want wasn't found. 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).
- tokamak-teapot 6y agoI think I’m just not used to faster package managers and I don’t install packages often enough for it to feel disruptive to wait a few seconds. 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.
- ratww 6y agoThe slowness is mostly due to Ruby and the git pull. I contributed in the past and reimplemented it in bash, and there isn't much going on, honestly. 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.
- sonu27 6y agoIt also has a fair share of problems. Like multiple users on the same machine, I had issues with permissions, etc
- mark_l_watson 6y agoI second that. On my M1 MacBook Pro, I have both the M1 version and Intel versions installed. I have found that if I use the Intel installation to install something like MIT-Scheme in a terminal running Rosetta, the it is available everywhere. It took me a little while to get that sorted out.
- SahAssar 6y agoIt's been argued that the recommended way it works is a security issue: https://applehelpwriter.com/2018/03/21/how-homebrew-invites-users-to-get-pwned/ https://applehelpwriter.com/2018/03/21/how-homebrew-invites-... https://askubuntu.com/questions/261326/is-it-safe-to-chown-usr-local https://askubuntu.com/questions/261326/is-it-safe-to-chown-u...
- tobylane 6y agoOn Apple Silicon it now installs to /opt/homebrew, a change they’ve been wanting to do for a while.
- matthewbauer 6y agoDoes /opt/homebrew still end up in root’s PATH, I wonder? That has the same issue that /usr/local has I think. Letting users mess with root’s environment basically means there is no real distinction between root and non-root.
- mikemcquaid 6y agoNo, it doesn’t.
- Hackbraten 6y agoIt’s not really insecure. See: https://security.stackexchange.com/q/187502 https://security.stackexchange.com/q/187502
- cactus2093 6y agoIt’s been a little while since I relied on it heavily, but you still can’t install/pin specific versions, right? That’s a huge limitation if you want to do any reliable development on macOS directly without using a vm or docker. 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.
- strokirk 6y agoCan you pin versions in apt? Last time I checked it involved a lot of work and swearing, but that might have improved lately.
- andoriyu 6y agoNot really, it was pretty verbose, but wasn't hard. Pinning is for setting package priority between multiple repos. 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.
- jameshart 6y agoYou can pin versions in brew (brew pin <package>) to prevent upgrades. 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.
- vetinari 6y agoAs others mentioned (it is slow, has problem with multiple users, cannot pin versions) it is also missing features the linux distribution have. For example, you cannot have Provides: alternatives as rpm/dpkg do, you must use packages for resolving dependencies as they are provided by upstream. 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.
- iamAy0 6y agoWhy would you install postgres through Brew though? 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.
- vetinari 6y agoBecause if you need to ingest some data, it is much slower with Docker Desktop for Mac :/ Also, I have some tools installed with brew, that have postgres as dependency (e.g. pgloader or mapnik).
- michaelcampbell 6y agoNot going to wade into the "should" or "shouldn't" of this, but I have used postgres-via-docker for ... few years now, and it is a DREAM. And I never have to worry about versions or dependencies (at least I haven't yet).
- earthboundkid 6y agoI've installed Postgres on my Mac with Homebrew, Docker, and https://postgresapp.com https://postgresapp.com. There are arguments for each of them. On the pro side: - 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.
- cageface 6y agoWhat kind of machine are you running windows on?
- varispeed 6y agoThe problem is that Apple does not want to spend money where they don't absolutely have to. In their mind Docker is someone else's problem and if that 3rd party will also pay salaries and taxes, it's perfect for Apple. I am sure once Docker commit resources and solve it, the Apple will be boasting how great Docker works on their platform.
- readbeard 6y agoI don’t know, supposedly [0] Apple provided patches to help get Blender running on M1. [0] https://www.reddit.com/r/blender/comments/jsc03l/blender_on_apple_m1_hardware/gc05gfw?utm_source=share&utm_medium=web2x&context=3 https://www.reddit.com/r/blender/comments/jsc03l/blender_on_...
- machello13 6y agoThere's a great deal of cases where Apple went out of their way to help out 3rd parties with compatibility, including quite a few cases with the M1 Macs themselves. Is your comment based on anything or just typical HN "Apple = evil"?
- ksec 6y agoThe is because those 3rd parties matter to Apple's ecosystem. And hence it is of their interest, Adobe, AutoDesk, Panic, or any creative tools. Docker and Developer Tools does not happen to be one of them.
- deleted 6y ago[deleted]
- 600frogs 6y agoI'm definitely interested in WSL for developing, but last time I tried it a while back (WSL2 just came out I think), there was basic functionality missing e.g. I couldn't write and run my own SystemD services. Has the situation improved since then? 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?
- abdusco 6y agoIt's not full-on systemd, but you can run init scripts on WSL startup as of Insider Build 21286. https://blogs.windows.com/windows-insider/2021/01/06/announcing-windows-10-insider-preview-build-21286/ https://blogs.windows.com/windows-insider/2021/01/06/announc...
- Tenoke 6y ago>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? 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.
- 600frogs 6y agoI did try VSCode remote running and debugging, but found it fiddly to work with and half-baked. Plus, I was sorely missing IntelliJ, so I quickly stopped trying it out - maybe I'd get used to it eventually, but it didn't seem worth the onboarding cost. The RDP and X410 solutions suggested in the replies to GP seem solid though.
- nickjj 6y ago> I assume that's still CLI only? 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-windows-with-wsl-2-docker-desktop-and-more https://nickjanetakis.com/blog/a-linux-dev-environment-on-wi...
- f6v 6y agoI heard WSL2 was no good.
- unicornfinder 6y agoWithout more detail it's hard to say much that's useful but in my experience WSL2 has been nothing short of excellent. Also switched from Mac to Windows with WSL and the development experience is much better.
- tyingq 6y agoPeople were frustrated mostly with 2 issues... 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.
- dgellow 6y agoMy main issue is the lack of support for serial (so, no USB support): https://github.com/microsoft/WSL/issues/2195 https://github.com/microsoft/WSL/issues/2195. Other that this I love Windows 10 + WSL2 as a dev environment.
- tyingq 6y agoIt's a little clunky, but you could use a Windows RFC2217 remote serial server with socat on the Linux side to make a virtual serial port tied to a real one. I've done this (albeit not with WSL), and it did work. https://gist.github.com/DraTeots/e0c669608466470baa6c https://gist.github.com/DraTeots/e0c669608466470baa6c
- tyingq 6y agoToo late to edit, but there's also an unapplied pull request that seems to make usb passthrough work: https://github.com/microsoft/WSL2-Linux-Kernel/pull/45 https://github.com/microsoft/WSL2-Linux-Kernel/pull/45
- cactus2093 6y agoThe only problems I’ve had with docker slowness (though it’s been a very significant problem) is shared file system performance. It’s made many use cases and tools that are slow to begin with (like webpack) basically unusable for a development workflow. 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.
- unilynx 6y agoIf you found this unusable, you probably haven't had to work with the Virtualbox-backed version of Docker for Mac :-) 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?
- girvo 6y agoI used to run my own Xhyve based VM just to avoid the brutal VirtualBox Docker system on macOS. Man that’s some bad memories. 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
- derefr 6y agoCreating and mounting a loop-volume within the HGFS and then running NPM in there, would probably also be helpful. It certainly is when wrangling a directory with lots of tiny inodes over SMB. (It’s also what Apple themselves do for running Time Machine over SMB: they create a sparsebundle image on the remote and mount it locally, and write to that.) (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.)
- cyberpunk 6y agoAm I the only one who, after installing some brew tool, every bin in /opt/homebrew is immediately kill -9’d at launch, and then I have to brew list | xargs brew reinstall? 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...
- jki275 6y agoAs a daily brew user, I've never heard of that problem.
- skohan 6y ago> Using Docker with WSL is a breeze 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
- atonse 6y agoWSL is Linux. They run the unmodified Linux kernel in a pico-process an docker runs on top of that. Technically there shouldn’t be file system issues right?
- skohan 6y agoHow does it work with local directories? Is there a separate file system for WSL, or does the linux kernel translate windows fs paths or something?
- H12 6y agoIt's a separate filesystem, but from WSL you can access Windows files in mounted drives via the `/mnt/<drive letter>` directory.
- dboreham 6y agoAnd vice versa: linux home dir is at something like \\wsl$\ubuntu\home\username
- radicalbyte 6y agoIt's the same filesystem with some kind of translation/adapter. I love it because it makes supporting our multi-platform OSS projects easy. 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".
- skohan 6y ago
- yrro 6y ago> Using Docker with WSL is a breeze Not if your Windows users have to use Direct Access to connect to your container registry...
- eecc 6y agoIt’s still a nightmare to run IntelliJ on the WSL mounts. Vscode support is much better but it’s support for JVM languages is definitely a downgrade
- easton 6y agoHave you tried JetBrains Projector? They have a special installer for WSL that sets everything up, and then you access the IDE from your local browser. It works very, very well. https://github.com/JetBrains/projector-installer https://github.com/JetBrains/projector-installer
- ajford 6y agoDo you use any other virtualization software along side HyperV? We have a lot of legacy stuff that integrates with VirtualBox, but wanted to start edging towards Docker. 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).
- yonixw 6y agoWhy not using HyperV itself instead of Vbox?
- ajford 6y agoBecause of a lot of existing internal tools that directly call and manage VBox to set up local testing environments and stacks. 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.
- jayfk 6y agoAre there any good iTerm like terminals for Windows available? Last time I checked, the terminal was horrible to work with.
- somebehemoth 6y agoI don't think there is anything as good as iTerm. ConEmu is not bad.
- johnhenry 6y agoNot sure if it's what you're looking for, but Microsoft did recently release a new terminal: https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701 https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk...
- bin_bash 6y agoThey’re investing in it but it’s no iTerm https://github.com/microsoft/terminal https://github.com/microsoft/terminal
- parhamn 6y agoAlacritty is cross platform and the terminal I use over iTerm on MacOS as well (it’s so freaking fast). It doesn’t have tab/windows management stuff but works great with Tmux.
- MayorMonty 6y agoWindows Terminal and Fluent Terminal are both good
- crb002 6y agoWSL is probably easier to write for XNU than it was for Windows. Yeah, silly that Apple hasn't yet.
- pjmlp 6y agohttps://www.opengroup.org/openbrand/register/ https://www.opengroup.org/openbrand/register/ No need for WSL.
- deergomoo 6y ago> Brew is good, but Linux package managers like pacman and apt are so much better 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.
- sgerenser 6y agoI’ve always preferred MacPorts to brew. I think you’ve nailed it, it just feels much more like the Linux package managers I’m used to. Homebrew has definitely won the popularity contest though.
- rconti 6y agoI used MacPorts ages ago, and honestly thought it went away, which is why I switched to Brew, which I've never gotten comfortable with.
- geoelectric 6y agoIIRC my issue with MacPorts was that it insisted on recompiling the world from its ecosystem as dependencies because it kept everything super-stable, whereas brew would attempt to use system ones if they were viable. It was more or less FreeBSD Ports vs. Debian apt-get as the model at that point, and MacPorts was (predictably) FreeBSD-like. 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.
- saagarjha 6y agoMacPorts has binary packages for most things these days.
- pkulak 6y agoIt's silver... :D https://www.protondb.com/app/2620 https://www.protondb.com/app/2620
- ojosilva 6y agoApple is not giving proper love to their breakthrough laptop chipset. They amazed the world with "neural net on chip" for ML, even mentioning Tensorflow explicitly in its launch. Here's the real deal: getting anything Tensorflow related to even compile on M1 is nothing short of a miracle. Yes, Apple has a binary version (yuck) of TF you can download, but that's not good enough as many projects need specific versions and not everyone (ie OSS devs) can spend that much effort on a fringe tech. 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.
- ogre_codes 6y agoGive me a break. 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-engineers 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.
- gh-throw 6y agoHuh. I've seriously used... I dunno, maybe five Linux package managers, on workstations and servers alike, plus poked at a couple others, and the only one I'd almost rather use day-to-day than Brew is Portage, but even that, probably not. 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.
- cromka 6y agoYeah, let's talk about how brew still can't just remove the leftover dependencies or uninstall a package with its otherwise unused dependencies without some extra command or hacks.
- mikemcquaid 6y ago‘brew autoremove’ does this.
- geoelectric 6y agobrew might have a discoverability challenge. I've been installing an rmtree helper to do this for years and didn't even know it was an option to autoremove them.
- cromka 6y agoIs this new? I swear I searched as recently as last week and the only thing that came up was "rmtree" and the "brew bundle dump && brew bundle --force cleanup" workarounds.
- 6y ago
- ogre_codes 6y agoIt’s not too difficult to get a Linux VM running on top of MacOS on the M1. Then you can do whatever you want on your M1 Mac and have a full Linux distribution in another window. Call of Duty is a whole other problem.
- m463 6y agoUnfortunately, I think apple only invests in things apple. So the "target market" is not developers for other platforms. 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)
- nine_k 6y agoBut where are you going to run the image? On a Mac Mini in your DC? 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.
- m463 6y agoI was thinking more of docker used for mac development, not docker used to deploy web apps.
- bunfunton 6y agoShould I use WSL 1 or 2? Coming from Linux trying to make something workable.
- musicale 6y ago> I wish Apple would give Docker some love like Microsoft does 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.
- apatheticonion 6y agoI'm 100% with you. Moved from MacOS to Windows because of WSL1. 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.