-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kaniko documentation should be more clear regarding required Linux Capabilities #778
Comments
Thanks @kravvcu for the detailed bug report. Thanks |
Hey, @tejal29 Thanks for the answer. I'll put it on my to-do list and try to contribute in the coming days / weeks if that's ok. Regards, |
sounds good! |
This comment may be of help: #1020 (comment) . One mentioned there that is not listed above is CAP_SETFCAP , but that may have been specific to the build in question at that time. That demonstrates the difficulty of documenting this, as what it done in the build can change the requirements significantly. It may be worth also pointing to the default set of capabilities the Docker daemon provides: |
I think this would be helpful. We've just upgraded our ver from 1.6.0 to 1.8.1 in our openshift env and suddenly build process broke with |
This article describes the set of capabilities kaniko uses when run from docker - so different IIUC than what capabilities would be needed for PSP but possibly useful for documentation: From the article:
Min set of capabilities needed for the analyzed run-with-docker + minimal-dockerfile:
|
Request summary
It needs to be explicitly stated in the documentation that some Linux capabilities might be required (apart from the permission to run Kaniko as root) in order to successfully build docker images using Kaniko (this is relevant for CI systems build on a PodSecurityPolicy(PSP)-secured Kubernetes cluster).
Description
There are not too many resources available online on the subject on how to setup a CI system using Kaniko on a PSP-secured Kubernetes cluster. One of such resources is this article, which suggests that Kaniko would only need the permission to run as root user, which, at least for me, is not the case. It so turns out that the rule of dropping all capabilities prevents even simple builds (example below). The question is: what is the minimal capability set which allows all (or most) Kaniko builds.
To Reproduce
Steps to reproduce the behavior:
docker run --rm --name kaniko --cap-drop=all -v $(pwd)/Dockerfile:/Dockerfile -v $(pwd):/kaniko-context -it gcr.io/kaniko-project/executor:latest -f /Dockerfile -c /kaniko-context --no-push
What am I seeing
Depending on which capabilities are missing:
Working command
docker run --rm --name kaniko --cap-drop=all --cap-add CHOWN --cap-add=SETUID --cap-add=SETGID --cap-add=FOWNER --cap-add=DAC_OVERRIDE -v $(pwd)/Dockerfile:/Dockerfile -v $(pwd):/kaniko-context -it gcr.io/kaniko-project/executor:latest -f /Dockerfile -c /kaniko-context --no-push
Additional Information
file1 and file2 are regular files with irrelevant contents
The text was updated successfully, but these errors were encountered: