DEV Community

Discussion on: How are docker images built? A look into the Linux overlay file-systems and the OCI specification

Collapse
 
mattnguyengit profile image
Matt Nguyen

I think: sudo umount /tmp/overlay-example/mount && rm -rf .* --> ...&& rm -rf *

Collapse
 
napicella profile image
Nicola Apicella

Good catch, it was a typo. Thanks

Collapse
 
mattnguyengit profile image
Matt Nguyen • Edited

No big deal, at least it throws an error. Not sure the feelings if the typo were rm -rf /* :))

Thread Thread
 
napicella profile image
Nicola Apicella

Even if it was "/*" it would have thrown an error, unless you were running as root. Note that only the mount is sudo-ed and that privileges are not propagated to the other commands in the && condition. Try:

> sudo whoami && whoami
root
napicella

That being said, the boy scout rule applies: never run as root and never copy/paste random commands (especially the ones which require privilege escalation) without knowing what they do :)