Skip to content

Conversation

@jlebon
Copy link
Member

@jlebon jlebon commented Mar 6, 2019

We were previously hitting issues with the final images having an MCS
label. This turned out to be due to the gf-oemid using /tmp within
the container. In the unprivileged path, the whole container filesystem
uses MCS and so the image created there would inherit that label.

Just fix this by making gf-oemid use a tmpdir in the destination path;
we're already in a temporary work directory anyway when calling it from
cmd-build. Staying on the same bind mount also ensures that we're not
copying the image across filesystems (and with reflinks on, even the
first copy is a no-op!), so this should make the build process a bit
faster too.

Finally, this also allows us to drop the call to chcon, which is
problematic for systems without SELinux enabled on the host.

@cgwalters
Copy link
Member

Awesome, thanks for tracking this down! Looks like it just needs a shellcheck fix.

We were previously hitting issues with the final images having an MCS
label. This turned out to be due to the `gf-oemid` using `/tmp` within
the container. In the unprivileged path, the whole container filesystem
uses MCS and so the image created there would inherit that label.

Just fix this by making `gf-oemid` use a tmpdir in the destination path;
we're already in a temporary work directory anyway when calling it from
`cmd-build`. Staying on the same bind mount also ensures that we're not
copying the image across filesystems (and with reflinks on, even the
first copy is a no-op!), so this should make the build process a bit
faster too.

Finally, this also allows us to drop the call to `chcon`, which is
problematic for systems without SELinux enabled on the host.
@jlebon
Copy link
Member Author

jlebon commented Mar 6, 2019

Fixed!

@cgwalters cgwalters merged commit 9d3e10b into coreos:master Mar 6, 2019
@jlebon jlebon deleted the pr/no-chcon branch July 6, 2020 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants