54 points
*

Image Transcription: Meme


A photo of an opened semi-trailer unloading a cargo van, with the cargo van rear door open revealing an even smaller blue smart car inside, with each vehicle captioned as “macOS”, “Linux VM” and “Docker” respectively in decreasing font size. Onlookers in the foreground of the photo gawk as a worker opens each vehicle door, revealing a scene like that of russian dolls.


I’m a human volunteer content transcriber and you could be too!

permalink
report
reply
11 points

Just need to put a JIT compiled language logo inside the blue car and caption it as “Containerise once, ship anywhere”.

permalink
report
parent
reply

Hoping somebody organizes a /c/TranscribersOfLemmy or /m/TranscribersOfKbin

permalink
report
parent
reply
52 points

Not just OSX: anyone using WSL on windows is an offender too

But as a WSL user, dockerised Dev environments are pretty incredible to have running on a windows machine.

Does it required 64 gig of ram to run all my projects? Yes. Was it worth it? Also yes

permalink
report
reply
14 points

I’m even worse, I have used wsl in a windows vm on my mac before haha

permalink
report
parent
reply

And use that to virtualize Android, to go even further beyond

permalink
report
parent
reply
6 points

My experience using docker on windows has been pretty awful, it would randomly become completely unresponsive, sometimes taking 100% CPU in the process. Couldn’t stop it without restarting my computer. Tried reinstalling and various things, still no help. Only found a GitHub issue with hundreds of comments but no working workarounds/solutions.

When it does work it still manages to feel… fragile, although maybe that’s just because of my experience with it breaking.

permalink
report
parent
reply
2 points

You can cap the amount of cpu/memory docker is allowed to use. That helps a lot for those issues in my experience, although it still takes somewhat beefy machines to run docker in wsl

permalink
report
parent
reply
3 points

When it happens docker+wsl become completely unresponsive anyway though. Stopping containers fails, after closing docker desktop wsl.exe --shutdown still doesn’t work, only thing I’ve managed to stop the CPU usage is killing a bunch of things through task manager. (IIRC I tried setting a cap while trying the hyper-v backend to see if it was a wsl specific problem, but it didn’t help, can’t fully remember though).

This is the issue that I think was closest to what I was seeing https://github.com/docker/for-win/issues/12968

My workaround has been to start using GitHub codespaces for most dev stuff, it’s worked quite nicely for the things I’m working on at the moment.

permalink
report
parent
reply
1 point

I found the same thing until I started strictly controlling the resources each container could consume, and also changing to a much beefier machine. Running a single project with a few images were fine, but more than that and the WSL connection would randomly crash or become unresponsive.

Databases in particular you need to watch: left unchecked they will absolutely hog RAM.

permalink
report
parent
reply
2 points
*

I work in a windows environment at work and my VMs regularly flag the infrastructure firewalls. So WSL is my easiest way to at least be able to partially work in my environment of choice.

permalink
report
parent
reply
1 point

I’ve used WSL to run deepspeed before because inexplicably microsoft didn’t develop it for their own platform…

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply
25 points

Does docker really spin up a VM to run containers?

permalink
report
reply
26 points

Yes, under windows and osx at least.

permalink
report
parent
reply
10 points

Is that still true? I use Linux but my coworker said docker runs natively now on the M1s but maybe he was making it up

permalink
report
parent
reply
9 points

I suspect they meant it runs natively in that it’s an aarch64 binary. It’s still running a VM under the hood because docker is really just a nice frontend to a bunch of Linux kernel features.

permalink
report
parent
reply
9 points

Maybe they just meant that it runs ARM binaries instead of running on Rosetta 2.

permalink
report
parent
reply
3 points

Docker requires the Linux kernel to work.

M1 is just worse arm. Since most people use x86_64 instead of arm, docker had to emulate that architecture and therefore had performance issues. Now you’ve got arm specific images that don’t require that hardware emulation layer, and so work a lot better.

Since that didn’t solve the Linux kernel requirement, it’s still running a VM to provide it.

permalink
report
parent
reply
1 point

Not making it up, but possibly confused. OCI containers are built on Linux-only technologies.

permalink
report
parent
reply
5 points

So that’s why it’s so memory hungry…

permalink
report
parent
reply
2 points

Try limiting it down to 2GB (there is an option in the Docker Desktop app). Before I discovered this option, the VM was normally eating 3-4GB of my memory.

permalink
report
parent
reply
4 points

On macos it does

permalink
report
parent
reply
23 points

Don’t forget the ARM64 to AMD64 conversion.

permalink
report
reply
10 points

I was about to comment this. That van also contains QEMU if your host is on ARM64.

permalink
report
parent
reply
4 points
*

Bloody hell

Edit: Reminds of the pimp my ride meme. “We made you an OS so you can VM your VM inside a VM!”

permalink
report
parent
reply
2 points

I was about to comment this. That car also contains QEMU in case you own a Mac with M1/M2 chip.

permalink
report
parent
reply
1 point

This was one of the reasons we switched to docker in the first place. Our Devs with M series processors spent weeks detangling issues with libraries that weren’t compatible.

Just started using Docker and all of those issues went away

permalink
report
parent
reply
21 points

When I was in school I once used a IOS emulator running inside a docker container of MacOS running on a linux machine. It works surprisingly smoothly.

permalink
report
reply
1 point

The difference between Docker and a VM is that Docker shares a kernel, but provides isolated processes and filesystems. macOS has a very distinct kernel from Linux (hence why Docker on macOS uses a Linux VM), I would be shocked if it could run on a Linux Docker host. Maybe you were running macOS in a VM?

permalink
report
parent
reply
3 points
*

Nope, Mac OS as a Docker container, it’s a thing: https://hub.docker.com/r/sickcodes/docker-osx

Also you don’t need a Linux VM to run docker containers on a Mac host btw

permalink
report
parent
reply
2 points

TIL, good to know!

permalink
report
parent
reply
1 point

The first layer in that docker container is actually KVM. So you run the container to run kvm, which then emulates osx.

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 7.2K

    Monthly active users

  • 954

    Posts

  • 37K

    Comments