Docker in ~100 lines of bash: https://github.com/p8952/bocker
I might write that something like:
cid="$(
ps o ppid,pid |
grep "^$(
ps o pid,cmd |
grep -E "^\ *[0-9]+ unshare.*$1" |
awk '{print $1}'
)" |
awk '{print $2}'
)"Having said that, looking at their code, I don’t get the impression they’re optimizing for LOC. There is plenty of verbosity and opportunity to remove lines of code if they wanted.
https://www.theregister.co.uk/2016/07/05/containers_state_of...