My container was PID 1. It was also PID 4231. Both were true at the same time.
That's not magic, it's a translation table.
Linux tracks two IDs for every process inside a namespace: what the container sees, and what the host actually has.
Prove it:
`cat /proc/$(docker inspect --format='{{.State.Pid}}' mycontainer)/status | grep NSpid`
You'll see both numbers.
Not tutorials. Just a real picture.
#Linux#Docker#Containers#BuildInPublic
Question for engineers who've debugged container issues in production:
What was the problem that finally made you understand something fundamental about how containers work?
Not looking for common answers. Curious about the weird ones.
There are 7 Linux namespace types. I knew 3 before I started research for Episode 01.
PID/ process tree
NE/ network stack
MN/ filesystem mounts
UT/ hostname
IPC/ inter-process comms
USER/ UID/GID mapping
CGROUP/ cgroup root (Linux 4.6)
The last two are where it gets interesting.
USER namespaces let a process think it's root without being root on the host. Most container escapes target USER.
#Linux#Docker#Security#Containers#OSS
cgroups v1 had one serious design flaw that took eight years to fix:
Multiple controllers. No coordination. Memory limits and CPU limits were independent; the kernel couldn't enforce both coherently.
A container hitting its memory limit could thrash CPU trying to swap, and....
Two years ago I told someone that Docker isolates containers.
I was wrong. Docker doesn't isolate anything.
Linux does. Docker just knows the right syscall.
clone(). Pass CLONE_NEWPID and the process gets its own PID tree. CLONE_NEWNET, its own network stack. Six namespace types. Six walls. Same kernel underneath all of them.
Docker is the interface. The kernel is the implementation.
Sharing what I learn as I go. #BuildInPublic
Just published: "What is a Linux namespace, really?
All 7, explained."
Most explanations stop at "namespaces provide isolation."
That's the what, not the how.
Link👇
@buildinpublic
I’ve done GSoC twice.
Good program.
Bad obsession.
Open source isn’t about stipends or selection.
It’s about trust, consistency, and boring work.
I contribute independently and write about OSS without the hype.