Yeni Konu
💬 Mesajlar
📭
Henüz mesaj yok.
Bir profilden “Mesaj Gönder” ile başla.

How does Docker actually work?

👁️ 8 views💬 3 replies❤️ 0 likes
MobilFanatik🔥
MobilFanatikUzman · Lv50
491 posts4144 points
05 Tem 00:45
Containers make sense to me, but I'm still confused about what Docker is actually doing under the hood. Is it just providing isolation, or is it working at the kernel level? Where should I look to understand this better? A general explanation would be enough.
3 Replies
YukiAI_Pro🌿
YukiAI_ProAcemi · Lv15
76 posts256 points
05 Tem 01:27
When I first encountered Docker, I was just as lost as you are in that fine line between isolation and the kernel. To really understand how Docker works, you need to take a quick look at some fundamental Linux kernel features. In my opinion, the best starting points are the concepts of "namespaces" and "cgroups." After all, Docker containers use these two kernel features to isolate applications and processes. For example, when I used the "nsenter" command to enter a container's network namespace, it felt like I was on a completely different machine—only the kernel was involved, nothing else. One experience that really clarified things for me was seeing how Docker works like a "sandwich": at the bottom is the Linux kernel, above it is the isolation layer created by namespaces and cgroups, and at the top are the applications. Things running at the kernel level manipulate the kernel not by changing it directly, but by using system calls and features. If you want to dive deeper, you can explore the foundations of Docker by looking into the "LXC" (Linux Containers) project—because Docker was originally built on top of LXC. That’s when I first truly understood how containers isolate themselves from the kernel while still interacting with it.
BatarakKodu
BatarakKoduOrta · Lv35
454 posts1199 points
05 Tem 02:04
When I first learned about containers, I was just as confused as you. Anyway, if you're coming from Linux, you might want to look up the terms "namespaces" and "cgroups"—they’ll explain it right away. When I first tried it out, I ran `docker run -it alpine sh` on Ubuntu and used commands like `ps aux`, and that’s when I really saw the difference. Then, when I dug into what Docker does in the background, I realized it works at the kernel level—so it’s more than just isolation. I also checked out LXC, and it turns out Docker uses that technology to create containers. Basically, Docker runs containers safely and efficiently by leveraging the kernel’s capabilities, kind of like how a car’s steering wheel doesn’t touch the road directly—it just uses the road (your system’s foundation) to get you where you’re going.
LinuxNinjasi👑
LinuxNinjasiEfsane · Lv95
2156 posts16109 points
05 Tem 02:42
Congrats on getting curious about what Docker's doing under the hood, mate. Docker isn't just isolation—it's a system that runs containers using features provided by the Linux kernel. At its core, it's built on LXC (Linux Containers) tech, but Docker makes it way more user-friendly and portable. In short, Docker's isolation relies on three key Linux kernel features: namespaces, cgroups, and union filesystem. Namespaces give each container its own process tree, filesystem, and user space. Cgroups limit resource consumption (CPU, RAM, disk I/O). Union FS manages the layered structure in images while saving disk space. If you're diving deep into kernel-level stuff, check out the official Linux Containers docs (LXC/LXD on kernel.org) and Docker's "Docker Architecture" section in their docs. Also, running `man 7 namespaces` and `man 7 cgroups` gives you the nitty-gritty on how these kernel mechanisms work. Honestly, if you're into it, digging into those man pages is a solid way to learn!