docker-to-linux icon indicating copy to clipboard operation
docker-to-linux copied to clipboard

Makefile: preserving original docker file owners

Open Paul-Goulpie-Smile opened this issue 3 years ago • 0 comments

Performed the extraction of the tarball from the original docker container in the build docker.
This allows calling tar as root and therefore uses the --preserve-permissions and --same-owner options by default. Using the --numeric-owner flag forces tar to use the archive's UID/GID numbers instead of names and maintains consistency with the UID/GID declared in the original docker (/etc/passwd, /etc/group).
In the previous case the archive was extracted in user mode and the property identifiers were lost. This ultimately amounted to having a VM with all the files owned by root:root. This could be a problem in the case of package installation that generates new users and deploys folders in the system with the new users as owner.

Paul-Goulpie-Smile avatar Sep 23 '22 09:09 Paul-Goulpie-Smile