News for hackers. Stuff that matters.
Re:More developers use Linux than Mac, according to 2022 Sta... by zitterbewegung on Wednesday December 28, 2022 @02:15PM (#34164634)
Honestly Docket Desktop for macOS has honestly been one of the most frustrating applications I have ever used and it isn’t Apple’s fault. Maybe with the new virtualization layer the developers at docker can fix it. One of the other issues is that it starts to create and enormous docker raw file.
Re:More developers use Linux than Mac, according to 2022 Sta... by jonwinstanley on Wednesday December 28, 2022 @02:21PM (#34164725)
What are the issues you see? My team all use Docker with M1 Macs and all seems to work fine, if a little slow.
Re:More developers use Linux than Mac, according to 2022 Sta... by geethree on Wednesday December 28, 2022 @02:30PM (#34164841)
My experience: it’s fine when using docker to run applications; painfully slow for a containerized development environments that want to share the file system with the host.

Lots to do to combat this, like: not sharing the volume with the host (vscode dev containers recommends this)

Re:More developers use Linux than Mac, according to 2022 Sta... by spamizbad on Wednesday December 28, 2022 @02:33PM (#34164886)
It's always the shared volumes that kill you. Especially for I/O intensive stuff like npm and webpack builds.

With that said if you're doing mostly backend stuff in Go/Python/Ruby etc it's quite good. Most of my complaints are from full-stack development.

Re:More developers use Linux than Mac, according to 2022 Sta... by yolo3000 on Wednesday December 28, 2022 @02:38PM (#34164933)
Why do you use docker to build local stuff?
Re:More developers use Linux than Mac, according to 2022 Sta... by ytjohn on Wednesday December 28, 2022 @03:03PM (#34165210)
Our team has pipelines that builds, runs, and tests our code in containers. We like to approximate this locally with docker compose. This helps eliminate things like forgetting to update pyproject.toml. Additionally, since the pipeline uses an internal artifactory/harbor (no external Internet), the containers we use have environment variables using the internal resources.
Re:More developers use Linux than Mac, according to 2022 Sta... by spamizbad on Wednesday December 28, 2022 @03:47PM (#34165743)
Good question: we actually decided to just not do this for local "statics". But having everything containerized makes it easier to attach editor contexts, work in the same environment as your CI/CD system etc.

The other upside of being fully containerized - even for FE stuff - is that you side-step having to worry about having any sort of "local" dev environment configured beyond Docker/Podman/etc and some environment variables set. It makes onboarding new developers a breeze and eliminates "Weird, works locally on my machine!" types of issues.

Re:More developers use Linux than Mac, according to 2022 Sta... by treis on Wednesday December 28, 2022 @04:26PM (#34166198)
Ruby takes forever to start the application because it has to open all the files. 4-8 minutes IIRC before the first test would run in our Rails monolith on my M1 pro.
Re:More developers use Linux than Mac, according to 2022 Sta... by black3r on Wednesday December 28, 2022 @04:52PM (#34166497)
If you're on Mac, have you tried the VirtioFS shared volume implementation yet? It was under experimental features until recently and you need macOS 12.5 to enable them, but it's very noticeably faster for I/O intensive stuff (my webpack builds are still 2x slower than native, but I wouldn't call it utterly unusable anymore)...
Re:More developers use Linux than Mac, according to 2022 Sta... by programmarchy on Wednesday December 28, 2022 @02:51PM (#34165067)
Qemu segfaults when compiling
Re:More developers use Linux than Mac, according to 2022 Sta... by oneplane on Wednesday December 28, 2022 @03:14PM (#34165346)
Sounds like a Qemu problem?
Re:More developers use Linux than Mac, according to 2022 Sta... by stusmall on Wednesday December 28, 2022 @05:29PM (#34166898)
Docker Desktop uses QEMU when building an x86 container on an M-series mac.
Re:More developers use Linux than Mac, according to 2022 Sta... by nicoburns on Wednesday December 28, 2022 @02:59PM (#34165154)
> and it isn’t Apple’s fault

Eh, yes it is. Apple doesn't provide a containerisation API for their OS, which means Docker is forced to run non-natively!

Re:More developers use Linux than Mac, according to 2022 Sta... by oneplane on Wednesday December 28, 2022 @03:13PM (#34165340)
Eh, no it isn't. apple does have a public container API but the problem is you still can't run Linux binaries on macOS no matter how many containers you put them in.

Containers on macOS don't use OCI images or anything like that, but scoped and grouped access to system resources with a separate user land that 'looks' like a full OS has been available for over 5 years. Even without that, XNU has plenty of facilities for it, and even if it didn't you'd still be able to use Launchd environments (which are more akin to LXC).

Docker relies on specific implementation details of the Linux kernel. It always has. That is why you always need a Linux OS somewhere to run the containers.

Re:More developers use Linux than Mac, according to 2022 Sta... by eptcyka on Wednesday December 28, 2022 @03:20PM (#34165409)
There is an OCI implementation for Windows which allows for Windows native containers. So docker can run on non-linux systems just fine, it's just that nobody cares. People use docker to package Linux applications, not because of some inate dockerness.
Re:More developers use Linux than Mac, according to 2022 Sta... by oneplane on Wednesday December 28, 2022 @03:22PM (#34165435)
OCI images yes, but that doesn't make them the same. OCI can be used to store many things, and those non-Linux OCI images will not run on Linux. Does that mean that it is Linux at fault for not running arbitrary formats from OCI images? No. This applies everywhere; if you build for a specific target and package it up, not using that target when trying to run it is a PEBCAK.

Example: there are artefacts you can store as OCI images that contain Mach-O binaries, and Windows and Linux won't really run those. You can even still PPC code in those binaries, and link to Cocoa frameworks. This means that the OS and architecture you are targeting will not be Windows or Linux, and that is not their fault.

Re:More developers use Linux than Mac, according to 2022 Sta... by eptcyka on Wednesday December 28, 2022 @05:13PM (#34166727)
In just pointing out that people are saying they want "docker" to work fine on non-Linux platforms but really, they want to run Linux binaries on non-linux kernels.
Re:More developers use Linux than Mac, according to 2022 Sta... by nicoburns on Wednesday December 28, 2022 @07:28PM (#34167937)
> In just pointing out that people are saying they want "docker" to work fine on non-Linux platforms but really, they want to run Linux binaries on non-linux kernels.

Is that true? Plenty of people are using multi-arch images (x86 and aarch64) which are essentially the Docker image equivalent of a fat binary. I might be wrong, but I think what I want are preconfigured macOS binaries packaged up a convenient image format with a layered filesystem, networking support, etc. Ideally with an equivalent linux image such that I can later switch the OS specifier and get an image containing an equivalent linux binary to run on linux.

I am for example quite happy to run a macOS native version of Postgres. But that doesn't give me the easy disposable database for testing that a docker-compose setup gives me. If I could specify that I want the "postgres" docker image in my docker-compose file, and running that file on macOS ran a macOS version of postgres in a macOS-native container then I'd be very happy.

Re:More developers use Linux than Mac, according to 2022 Sta... by oneplane on Wednesday December 28, 2022 @09:40PM (#34168810)
I think it's more than just multi-arch, it's also multi-OS (i.e. if we take Windows and BSD into account too we'd get 8 image types required for just 4 operating systems and 2 architectures if kept 'simple').

Packaging (including fat binaries but also byte code self-unpackers) has tried to make this possible for decades but it just won't stick. Take Debian or RedHat packages for example, there have been tools and repositories for very long times that were meant to make a universal method of distributing pre-packaged (and natively also chrootable/jailable) software for a multitude of architectures and operating systems possible, but package authors just didn't really want to do the work for what is essentially not something they wanted themselves.

Building software for 1 or 2 major release versions within a single operating system is hard enough, tacking on extra systems is usually a step too far.

The closest we got (and it still exists) is autotools, but that's just build tooling. It does however make it possible to build software from a single source for many targets and check for all the required features ahead of time. But this is so close to developing the software itself that it's not really compatible with the influx of end-user-style developers that expect pre-packaged 'commercial grade' software, which is essentially what Docker and OCI and Containers are.

The only 'new' thing so far has been cgroupsv2, the v1 version and everything else (distribution, sandboxing, capabilities, separate user land etc) has been done for over three decades. But again, using it means knowing how to use chroot, cap, tun and jail for example, and not everyone wants to learn that much. So we get things like docker, which under the hood does exactly that, plus some union filesystem magic to make it cheaper/faster for registries to store data; essentially a re-implementation of dynamic linking and shared libraries, but for files.

So now we have created an interface (docker) that is easy to adopt, easy to promote and easy to use, but it's hard-wired into Linux (the kernel) and only much later (post-OCI) got some hacked up windows version that is completely different and doesn't work anywhere else (because, well duh, not-windows isn't going to run windows apps). Aside from the fact that it's an OCI artefact, windows containers have very little to do with docker containers as we know them.

Most of this stuff also didn't really come from a need to get containers on windows (or macOS) but from the need to get more 'developer light edition' into the workforce, which can be trained and onboarded faster. If you can get people to ignore the foundation they stand on, they can be put to work in building upwards much sooner. This does of course come to bite everyone in the ass at some point, because if you're standing on top some 'magic' infrastructure and something breaks, it's going to be really hard to fix it. Right now we're all trying to make it redundant enough so we can ignore the breakage, but I doubt this is a winnable race.

Docker is a convenience, not a technical solution to a technical problem.

Re:More developers use Linux than Mac, according to 2022 Sta... by nicoburns on Wednesday December 28, 2022 @07:29PM (#34167945)
> Example: there are artefacts you can store as OCI images that contain Mach-O binaries, and Windows and Linux won't really run those.

Will macOS run them? That seems to be the missing functionality.