Hacker News new | ask | show | jobs
by sofixa 250 days ago
Docker works very weirdly (it's a desktop application you have to install that has usage restrictions in enterprise contexts, and it's inside a VM so some things don't work), or you have to use an alternative with similar restrictions (Podman, Rancher Desktop).

The OS also has weird rough edges when used from the terminal - there are read-only parts, there are restrictions on loading libraries, multiple utilities come with very old versions or BSD versions with different flags than the GNU ones you might be used to coming from Linux, the package manager is pretty terrible. There are things (e.g. installing drivers to be able to connect to ESP32 devices) that require jumping through multiple ridiculous hoops. Some things are flat out impossible. Each new OS update brings new restrictions "for your safety" that are probably good for the average consumer, but annoying for people using the device for development/related.

3 comments

>The OS also has weird rough edges when used from the terminal - there are read-only parts, there are restrictions on loading libraries, multiple utilities come with very old versions or BSD versions with different flags than the GNU ones you might be used to coming from Linux, the package manager is pretty terrible.

You use nix or brew (or something like MacPorts).

And they are mighty fine.

You shouldn't be concerned with the built-in utilities.

IIRC many of the built-in tools were updated from FreeBSD in the last release, but they'd still be different from GNU.
Brew is pretty terrible though. It's slow, and doesn't handle updates/versions/dependencies all that well.

I've had it make major (with breaking changes) updates to random software when asked to install something unrelated.

  HOMEBREW_NO_AUTO_UPDATE=1

  HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1

  export HOMEBREW_NO_AUTO_UPDATE HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK
brew is fine. Not the best package manager, not the worst one either.
Dovker on mac has one killer feature though: bindmounts remap permissions sensibly so that uid/gid in the container is the correct value for the container rather than the same uid/gid from the host.

the workarounds on the internet are like "just build the image so that it uses the same uid you use on your host" which is batshot crazy advice.

i have no idea how people use docker on other platforms where this doesn't work properly. One of our devs has a linux host and was unable to use our dev stack and we couldn't find a workaround. Luckily he's a frontend dev and eventually just gave up using the dev stack in favour of running requestly to forward frontend from prod to his local tooling.

I suggest trying Nix on Macos, it is very nice as a package manager but also it can be used as a way to replace Docker (at least for my needs, it works very well). This days I don't even bother installing brew on my Mac, I only use Nix.
Ended up doing the same, no brew, no docker

System-wide dependencies installed via home manager, and project-related installed via nix flakes which is created on project basis

I can spin up a new identical environment on new macos in 15 mins

Very interesting. I’m going to start using Nix it seems based off skimming how it works and can replace docker.