Skip to content

Drop the need for --privileged for all subcommands except build#361

Merged
lzap merged 3 commits intoosbuild:mainfrom
ondrejbudai:remove-entrypoint
Nov 5, 2025
Merged

Drop the need for --privileged for all subcommands except build#361
lzap merged 3 commits intoosbuild:mainfrom
ondrejbudai:remove-entrypoint

Conversation

@ondrejbudai
Copy link
Member

main: drop the bash entrypoint

Instead, use the one we share with bib.


main: prepare osbuild env only for the build subcommand

Prior this commit, we prepared the environment in the main function.
This meant that image-builder needed a lot of privileges even for
operations like describe. However, the environment changes are only
needed for running osbuild, thus it makes sense to run it only for
the build command.


Fixes #103

Instead, use the one we share with bib.
Prior this commit, we prepared the environment in the main function.
This meant that image-builder needed a lot of privileges even for
operations like describe. However, the environment changes are only
needed for running osbuild, thus it makes sense to run it only for
the build command.
@ondrejbudai ondrejbudai requested a review from a team as a code owner November 5, 2025 12:41
@ondrejbudai ondrejbudai requested review from achilleas-k, supakeen and thozza and removed request for a team November 5, 2025 12:41
Copy link
Member

@thozza thozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gist of the change LGTM, however, tests are failing

With the new entrypoint handling in the Go code (see previous commits),
we now run chcon there (because we run the tests in a container, so
the entrypoint code gets triggered). In order to do that, we need
more privileges, so this commit adds --privileged to the test suite.
@lzap
Copy link
Contributor

lzap commented Nov 5, 2025

The PR title does not match, or I am not getting it. One of these :-)

@supakeen
Copy link
Member

supakeen commented Nov 5, 2025

I don't really grok it either; I understand the code but the commit messages are a bit confusing. I can run image-builder fine without being root (for describe, manifest, list, etc).

I'll assume this is only applicable for running inside a container (since that's what the code does) and that the commit/title could make it a bit more clear.

Copy link
Contributor

@lzap lzap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, commit messages do appear to be fine we can edit PR title later if needed. Code looks good.

@lzap lzap added this pull request to the merge queue Nov 5, 2025
Merged via the queue into osbuild:main with commit 5fddcab Nov 5, 2025
38 checks passed
@ondrejbudai ondrejbudai deleted the remove-entrypoint branch November 6, 2025 08:40
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.

Running without --privileged returns a mount error

4 participants