-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add SETFCAP Linux capability for Kaniko buildstrategy #415
Add SETFCAP Linux capability for Kaniko buildstrategy #415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another capability to consider adding to Kaniko and Buildah by default is MKNOD
. Some packages create device nodes during apt-get
or dnf install
.
See Sascha Grunert and Dan Walsh's talk from KubeCon EU 2020: https://youtu.be/RoiIx8mcECY?t=1479
good stuff @adambkaplan , i was looking for this type of information |
Good mention. Unfortunately, not very detailed information on what exactly fails. The interesting point imo now is whether the packages that need this capability during installation are relevant for a reasonable image build. Googling only pointed me to Other question: should we block this PR which is about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving as discussed in October 5th, 2020 Community Meeting #418 .
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SaschaSchwarze0 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
We had a customer problem when build a source code repo from: https://github.com/nheidloff/code-with-quarkus/blob/master/src/main/docker/Dockerfile.multistage
This build fail at the step
microdnf update
:It will fail at step-step-build-and-push step, and the final error is:
Finally, I found the root cause. We didn't enable a Linux Capability
setfcap
in the Kaniko build strategy, without this permission, some system installations cannot work. I added it and test, the build works for me:And the deployment which is based on this image also works fine, You can see my application screenshot below:
Here is the introduction about this setfcap Linux Capability:
From the info, it is not very risky for us to enable this permission, it is just used to set file capabilities on a file system. And we also see some of the user cases are install something by using microdnf or apt-get, so it should be a valid scenario.