News for hackers. Stuff that matters.
Re:Docker for Mac M1 RC by countmora on Friday March 19, 2021 @06:46AM (#26511874)
Where 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.
Re:Docker for Mac M1 RC by vetinari on Friday March 19, 2021 @07:37AM (#26512140)
As 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.

Re:Docker for Mac M1 RC by iamAy0 on Friday March 19, 2021 @08:02AM (#26512294)
Why 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.

Re:Docker for Mac M1 RC by vetinari on Friday March 19, 2021 @08:15AM (#26512378)
Because 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).

Re:Docker for Mac M1 RC by Toutouxc on Friday March 19, 2021 @08:38AM (#26512567)
> Those times are way gone, that's the purpose of containers.

Please elaborate on the claim that "running a SQL database" is the purpose of containers.

Re:Docker for Mac M1 RC by vetinari on Friday March 19, 2021 @08:46AM (#26512630)
To be fair to GP, running sql database inside a container does have benefits for development, and in many situations, for deployment too.

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.

Re:Docker for Mac M1 RC by Terretta on Friday March 19, 2021 @09:14AM (#26512896)
Why wouldn’t you want to run a database under namespaces and cgroups from a dependency-bundled live archive file tree?

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.

Re:Docker for Mac M1 RC by Spivak on Friday March 19, 2021 @10:43AM (#26513888)
I think you're being unkind to containers. Yes it's easy to say that "containers aren't a thing" and then list all the little tools that are used to implement them. That doesn't make them not real any more than any other abstraction.

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.

Re:Docker for Mac M1 RC by michaelcampbell on Friday March 19, 2021 @08:18AM (#26512401)
Not 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).
Re:Docker for Mac M1 RC by earthboundkid on Friday March 19, 2021 @09:19AM (#26512936)
I've installed Postgres on my Mac with Homebrew, Docker, and 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.

Re:Docker for Mac M1 RC by SahAssar on Friday March 19, 2021 @07:30AM (#26512091)
Re:Docker for Mac M1 RC by tobylane on Friday March 19, 2021 @07:48AM (#26512205)
On Apple Silicon it now installs to /opt/homebrew, a change they’ve been wanting to do for a while.
Re:Docker for Mac M1 RC by matthewbauer on Friday March 19, 2021 @01:56PM (#26516376)
Does /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.
Re:Docker for Mac M1 RC by mikemcquaid on Friday March 19, 2021 @03:04PM (#26517149)
No, it doesn’t.
Re:Docker for Mac M1 RC by Hackbraten on Friday March 19, 2021 @03:05PM (#26517158)
It’s not really insecure. See: https://security.stackexchange.com/q/187502
Re:Docker for Mac M1 RC by dastx on Friday March 19, 2021 @07:03AM (#26511953)
Last 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.

Re:Docker for Mac M1 RC by vkoskiv on Friday March 19, 2021 @07:15AM (#26512011)
Still 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.
Re:Docker for Mac M1 RC by cactus2093 on Friday March 19, 2021 @07:31AM (#26512097)
It’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.

Re:Docker for Mac M1 RC by jameshart on Friday March 19, 2021 @09:02AM (#26512782)
You 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.

Re:Docker for Mac M1 RC by strokirk on Friday March 19, 2021 @08:48AM (#26512646)
Can you pin versions in apt? Last time I checked it involved a lot of work and swearing, but that might have improved lately.
Re:Docker for Mac M1 RC by andoriyu on Friday March 19, 2021 @01:48PM (#26516270)
Not 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.

Re:Docker for Mac M1 RC by mark_l_watson on Friday March 19, 2021 @07:30AM (#26512088)
I 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.
Re:Docker for Mac M1 RC by vkoskiv on Friday March 19, 2021 @07:13AM (#26512002)
I think the main criticism of homebrew is that it's really slow.
Re:Docker for Mac M1 RC by tokamak-teapot on Friday March 19, 2021 @07:15AM (#26512012)
Slow 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.
Re:Docker for Mac M1 RC by ratww on Friday March 19, 2021 @07:34AM (#26512129)
It 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).

Re:Docker for Mac M1 RC by tokamak-teapot on Friday March 19, 2021 @12:44PM (#26515490)
I 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.

Re:Docker for Mac M1 RC by ratww on Friday March 19, 2021 @01:25PM (#26515951)
The 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.

Re:Docker for Mac M1 RC by varjag on Friday March 19, 2021 @07:31AM (#26512094)
Well, 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.

Re:Docker for Mac M1 RC by sonu27 on Friday March 19, 2021 @07:27AM (#26512071)
It also has a fair share of problems. Like multiple users on the same machine, I had issues with permissions, etc