-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
rootfs not labeled with SELinux mount label #2320
Comments
This may be the root cause for #2295 as well - if the overlayfs is not mounted with a I don't have a quick way to validate that hypothesis at the moment. Happy to have this resolved as a duplicate if it turns out to be the same problem. |
I'm getting this error on fedora 34, using
The following selinux error comes up when this happehns:
sealert output:
|
Maybe the following will be helpful - I had a similar error when running buildkit 0.9.3 on RHEL 7/8. Fixed it by recompiling buildkit, explicitly adding selinux tag. (However, in my case I ran buildkit directly, without docker) |
Could you explain exactly what you did? |
If you look into Dockerfile, there's a line like this: You can pass the tag via the build argument BUILDKITD_TAGS="selinux" (or add tag "selinux" directly to go build --tags options in Dockerfile) |
Same problem here with v0.10.1 and Fedora 37 |
I asked the buildkit slack channel for advice and was told that my issue is probably related to this issue. |
I don't really have a machine readily available to test on. |
It seems impossible to use BuildKit at the time on a system with SELinux: moby/buildkit#2320. In the meantime, one can use Podman on these systems. Signed-off-by: Yann Soubeyrand <yann.soubeyrand@camptocamp.com>
In #1966 support was added for obtaining the process and mount labels on an SELinux-enabled system.
This works correctly for labeling the process, and for labeling most mounts. However, the new
generateSecurityOpts()
function is called fromoci.GenerateSpec
, which only happens after mounting the rootfs.As a result, the root filesystem is not mounted with the expected mount label, and may not be writable by the container process, which ends up with a restricted label.
We first observed this in bottlerocket-os/bottlerocket#1187 but one of our developers saw a similar problem with a new Fedora install.
The text was updated successfully, but these errors were encountered: