Skip to content
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

feature request: temporarily switch to user ROOT using xml configuration #2707

Open
jochenr opened this issue Feb 21, 2024 · 6 comments
Open
Labels
enhancement New feature or request

Comments

@jochenr
Copy link

jochenr commented Feb 21, 2024

Component

Kubernetes Maven Plugin

Is your enhancement related to a problem? Please describe

I like to build container (advanced) images without using a Dockerfile, so that I can have the whole configuration in my maven pom.xml.

Describe the solution you'd like

As discussed in #2703
It would be great if I can switch USERs several times during a build of a container image.

In a Dockerfile I can do something like this to switch to the root user for building the image and swuícth back at the end

FROM registry.access.redhat.com/ubi8/....

USER root

COPY .....

RUN ....

USER 185

This seems to be unpossible when using the XML configuration in a maven pom.
Using the tag I can get the "USER 185" line at the end of the genberated dockerfile

<image>
    ....
    <build>
        ...
        <user>185</user>
    </build>
</image>

To use ROOT for executing a RUN command something like this would be good:

<runCmds>
    <runCmd>
        <user>root</user>
        <run>update-ca-trust</run>
    </runCmd>
</runCmds>

?

already has a subtag,
So for me it makes sense that the s within also get a way to specify a user.

Describe alternatives you've considered

As an alternative I can use a Dockefile
But I don't want to do that, because some images I have to use Dockerfiles while for others I can stay within the maven pom....

Additional context

No response

@jochenr jochenr added the enhancement New feature or request label Feb 21, 2024
@Pushkal-G
Copy link
Contributor

Hi @jochenr, How much effort is required for this? If I can take this up and start working on?

@jochenr
Copy link
Author

jochenr commented Mar 2, 2024

Hello @Pushkal-G ,

sorry, cannot estimate how much effort it takes, since I don't know the codebase of JKube.
I never worked on it myself, I'm just a user.

Best regards,
Jochen

@manusa
Copy link
Member

manusa commented Mar 4, 2024

Hi @jochenr, How much effort is required for this? If I can take this up and start working on?

A very deep and important refactor. It's not a trivial task and will probably involve architectural decisions and breaking changes.

@Pushkal-G
Copy link
Contributor

So, what do you suggest, should i work on this?

@manusa
Copy link
Member

manusa commented Mar 4, 2024

So, what do you suggest, should i work on this?

this is definitely not a good-first-issue or a help-wanted issue.

In any case, feel free to suggest an approach or even a PR with a working PoC for further consideration.

@rohanKanojia
Copy link
Member

I think this pull request might be related to this issue fabric8io/docker-maven-plugin#1772 . A docker-maven-plugin contributor has created this pull request to allow specifying USER in Dockerfile with RUN commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants