News for hackers. Stuff that matters.
Re:A Workshop on Linux Containers: Rebuild Docker from Scratch by eftychis on Monday April 02, 2018 @05:12PM (#16739363)
Pretty much. Usually you run your own init that starts the desired process. If you as a process have id (pid) 1 then you need to manage orphaned processes (and zombies) and general signal handling (e.g. SIGTERM).

There is a lot of cgroups and capabilities tweaking involved also. You can also use bpf (e.g. seccomp-bpf to restrict system calls etc.

In general you i) add the illusion of king in your little own world ii) provide necessary handling that the kernel expects from a king iii) restrict resources (e.g. memory, system calls,...) and facilitate communication with the rest of the worlds.

Re:A Workshop on Linux Containers: Rebuild Docker from Scratch by zenlikethat on Tuesday April 03, 2018 @09:25PM (#16751089)
There is also now a `--init` flag for docker run and for dockerd that will run a Pretty Reasonable PID1 (tini) automatically.