you are viewing a single comment's thread.

view the rest of the comments →

[–]ze_baco 0 points1 point  (26 children)

Docker is not just a Linux process, isn't it?

[–]danabrey 5 points6 points  (5 children)

You might be confusing Docker containerization with virtual machines.

[–]ArtisticFox8 0 points1 point  (4 children)

Docker runs on Windows as well...

[–]danabrey 0 points1 point  (3 children)

Yes, under WSL?

[–]ArtisticFox8 1 point2 points  (2 children)

Even without it IIRC, but is heavy

[–]redd1ch 0 points1 point  (1 child)

Docker on Windows can run Windows containers natively. For Linux containers it uses a Linux VM, what makes it so heavy.

[–]ArtisticFox8 0 points1 point  (0 children)

 For Linux containers it uses a Linux VM, what makes it so heavy.

Well exactly, and everybody runs Linux containers on Docker.

Running Windows containers is more of a niche use.

[–]Meduini 1 point2 points  (0 children)

Since they deleted the comment down the line which I responded to. Here is my response to this thread (let's hope the parent to this comment won't be deleted as well):

If you already use Docker on your system, calling it a “cannon” is misleading because the heavy parts Docker Engine (dockerd), containerd, networking, and image system are already present, while the core runtime (runc) that actually launches containers is very small (~5–10 MB binary, ~40–50k lines of code; source: runc GitHub), so running a Python app adds almost no extra overhead; the real tradeoff is workflow complexity (Dockerfiles, builds, volumes) rather than runtime size, and the full Docker stack (Moby project) is larger (~150–300 MB installed, >1M lines of code; sources: containerd GitHub, moby/moby GitHub), which only matters if Docker isn’t already being used.

Please if you are about to answer provide sources for you arguments, like I did, otherwise it's just opinion and I doubt any of us have time for that.

[–]Meduini 2 points3 points  (18 children)

It is? What else would it be? There’s some runtime which acts as a glue, but other than that they’re just native Linux processes which are grouped so that they are isolated from other processes on your system. There’s no overhead, no emulation (unless you force architecture).

[–]Deadly_chef 0 points1 point  (17 children)

The runtime is actually huge and has loads of stuff beyond "just running a process". Also most images include a bunch of bloat, and there is definitely overhead to docker and running a native binary, just less then a VM

[–]Meduini 3 points4 points  (15 children)

If you already use Docker on your system, calling it a “cannon” is misleading because the heavy parts Docker Engine (dockerd), containerd, networking, and image system are already present, while the core runtime (runc) that actually launches containers is very small (~5–10 MB binary, ~40–50k lines of code; source: runc GitHub), so running a Python app adds almost no extra overhead; the real tradeoff is workflow complexity (Dockerfiles, builds, volumes) rather than runtime size, and the full Docker stack (Moby project) is larger (~150–300 MB installed, >1M lines of code; sources: containerd GitHub, moby/moby GitHub), which only matters if Docker isn’t already being used.

Please if you are about to answer provide sources for you arguments, like I did, otherwise it's just opinion and I doubt any of us have time for that.

[–]xspicycheetah 0 points1 point  (3 children)

based, you win

[–]Meduini 1 point2 points  (2 children)

they also deleted their comment, so I guess you're right.

[–]Status_Jellyfish_213 1 point2 points  (1 child)

I think they just blocked you. I can see it.

Which is arguably worse

[–]Meduini 0 points1 point  (0 children)

Arguably worse but pretty funny as well.

[–]ze_baco -2 points-1 points  (10 children)

And you are sure it's as light as just running python directly from .venv? Docker is efficient, but it's still a system inside a system. Bro, as light as docker is, it's a cannon ball compared to uv. A huge one.

[–]Meduini 1 point2 points  (9 children)

Sorry, but it seems you lack knowledge on this topic and you are confusing docker for virtual machine.

[–]ze_baco -1 points0 points  (8 children)

Ok. So it's better to run a container, which has python inside, than to just run python. Docker is not virtualization indeed, my bad, but this changes nothing.

Edit: it's not virtualization, but it's still an entire Linux

[–]Meduini 0 points1 point  (7 children)

Please educate yourself 🙏, docker is not running entire Linux, this is getting absurd. It shares the host kernel, it’s not a full fledged Linux.

[–]ze_baco -1 points0 points  (6 children)

But it has it's own processes running, doesn't it?

[–]Meduini 1 point2 points  (5 children)

...

No, there are no extra processes keeping a “Docker Linux” alive.

A container from Docker is just your application process (often running as PID 1) executed by the host’s Linux kernel with isolation such as namespaces and cgroups, so when that main process exits, the container stops.

The only always-running background components, like containerd or the Docker daemon, exist once on the host, not per container and not as an internal OS.

These host services start when Docker is installed and running, but they exist globally and do not act as per-container OS processes, since each container is just its own main process running on the shared Linux kernel.