Open aznashwan opened 2 weeks ago
There are numerous examples of OCI images which are run as a non-root [...] (e.g: the Nginx Ingress Controller image which runs as www-data).
Also wanted to confirm the caps are present in non-ROCK images:
docker run -u root --rm -it --entrypoint bash registry.k8s.io/ingress-nginx/controller:v1.11.0 -c "apk update && apk add libcap && setcap -v cap_net_bind_service=+ep /nginx-ingress-controller"
# /nginx-ingress-controller: OK
Thanks for raising this @aznashwan
For future reference, here's the original discussion.
Bug Description
File capabilities set via xattrs on files during ROCK build time are not preserved in the final ROCK image.
There are numerous examples of OCI images which are run as a non-root user but require root-like capabilities like binding port numbers under 1024 with
cap_net_bind_service
(e.g: the Nginx Ingress Controller image which runs aswww-data
).To Reproduce
Build the below-listed
rockcraft.yaml
sample and check the caps in the final file as follows:Environment
Host: Ubuntu 22.04 on x86_64 VM on VMWare Rockcraft: 1.5.3 installed via
snap
Docker: 24.0.7-0ubuntu2~22.04.1 amd64 installed viaapt
rockcraft.yaml
Relevant log output