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

Dockerfile.jvm build fails with kaniko: user: unknown user 1001 #25499

Closed
weltonrodrigo opened this issue May 11, 2022 · 13 comments
Closed

Dockerfile.jvm build fails with kaniko: user: unknown user 1001 #25499

weltonrodrigo opened this issue May 11, 2022 · 13 comments
Labels
kind/bug Something isn't working triage/needs-triage triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@weltonrodrigo
Copy link
Contributor

weltonrodrigo commented May 11, 2022

Describe the bug

This is a known bug in kaniko GoogleContainerTools/kaniko#1456, where commands like

COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/

fail with:

error building image: error building stage: failed to execute command: getting user group from chown: user: unknown user 1001

It would be nice, as the kaniko bug is >1 year old, that quarkus could provided a (probably harmless) workaround on it's Dockerfiles:

RUN microdnf install shadow-utils
RUN adduser -u 1001 appuser

COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/

This bug makes quarkus impossible to build on gitlab CICD, as a kaniko build is the recommended way to build a docker image there.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@geoand
Copy link
Contributor

geoand commented May 16, 2022

Seems reasonable. @maxandersen WDYT?

@maxandersen
Copy link
Contributor

Hmmm - doesn't this end up conflicting with kuberneteS/openshift owner ids?

@geoand
Copy link
Contributor

geoand commented May 16, 2022

According to the proposal, we wouldn't change the user ids, we'd just run RUN adduser -u 1001 appuser to make sure the user exists.

@maxandersen
Copy link
Contributor

As long as we can verify It still works in openshift It's fine.

I.e. take particular notice of https://docs.openshift.com/container-platform/4.2/openshift_images/create-images.html section of "support arbitrary user ids"

@geoand
Copy link
Contributor

geoand commented May 16, 2022

As long as we can verify It still works in openshift It's fine.

Summoning @rsvoboda for this :)

@ejba
Copy link
Contributor

ejba commented May 16, 2022

giving my two cents if I can :)

IMHO, there's a concern here that it's adding a new layer to the image with more libraries that another set of users probably don't need. May I suggest creating some cli option to give developers the option to choose to create the user?

@geoand
Copy link
Contributor

geoand commented May 16, 2022

If we are concerned about the extra layer, then I would not go so far as to add a new flag to the Dockerfile. We could just keep the commands in the Dockerfile but commented out with an explanation of when it might make sense to use them.

@ejba
Copy link
Contributor

ejba commented May 16, 2022

We could just keep the commands in the Dockerfile but commented out with an explanation of when it might make sense to use them.

After that, adding some documentation on website telling gitlab users to uncomment those lines.

@geoand
Copy link
Contributor

geoand commented May 16, 2022

Makes sense

@rsvoboda
Copy link
Member

Hi @gastaldi / @iocanel, could you check the suggested approach in the engineering OCP env before we will put our hands on it, please? Right now, we are busy with other priority tasks.

@rsvoboda
Copy link
Member

Would be handy to have kubernetes/openshift checks (#17674) in place.

@Sgitario
Copy link
Contributor

Sgitario commented Oct 3, 2022

@geoand @weltonrodrigo I think this issue is gone thanks to the changes in c24179a. The new template is no longer using the user 1001 (I could reproduce this issue and after updating the Dockerfile, it works fine in OpenShift).

@geoand
Copy link
Contributor

geoand commented Oct 3, 2022

Thanks for investigating @Sgitario!

Let's close this in light of the information you mention above.

@geoand geoand closed this as completed Oct 3, 2022
@geoand geoand added triage/out-of-date This issue/PR is no longer valid or relevant triage/needs-triage labels Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/needs-triage triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

6 participants