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

Error building Dockerfile due to COPY --chown=myuser:myuser syntax with non-existent user #661

Closed
FreedomBen opened this issue Aug 13, 2024 · 5 comments

Comments

@FreedomBen
Copy link

Description:

When building the Dockerfile with Podman and Docker, we encounter an error at the COPY --chown=myuser:myuser entrypoint.sh /entrypoint.sh step because the user myuser does not exist. This prevents the build process from completing successfully.

Details:

When building, this is the relevant output. Podman and Docker both fail at the same step but provide slightly different error messages that mean the same thing:

Podman:

2/2] STEP 11/15: COPY --chown=myuser:myuser entrypoint.sh /entrypoint.sh
Error: building at STEP "COPY --chown=myuser:myuser entrypoint.sh /entrypoint.sh": looking up UID/GID for "myuser:myuser": determining run uid: user: unknown user error looking up user "myuser"

Docker:

Step 20/24 : COPY --chown=myuser:myuser entrypoint.sh /entrypoint.sh
unable to convert uid/gid chown string to host mapping: can't find uid for user myuser: no such user: myuser

I don't see that user referenced anywhere else in the whole repo (grep) so I'm not sure what was intended.

@chrisclark
Copy link
Collaborator

Ack, sorry.

Would you prefer I remove the --chown step and just run:

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

And assume you are running everything with the correct permissions, or I could create a user up front in the Dockerfile:

RUN useradd -ms /bin/bash myuser

Happy to fix and put in a point release. LMK what makes sense. If you have other suggestions for the dockerfile, feel free to suggest. The purpose so far is really about an easy way to get started with local dev.

@chrisclark
Copy link
Collaborator

@FreedomBen should be fixed here:

#662

Any chance you could pull it down and confirm it's working? Then I can push a release with it.

@chrisclark chrisclark mentioned this issue Aug 14, 2024
@FreedomBen
Copy link
Author

Thank you! Yes I'll pull it down and test it.

It works!

@chrisclark
Copy link
Collaborator

Ok will merge and get release 5.2 out hopefully this week.

@chrisclark
Copy link
Collaborator

Released in 5.2b1:

https://pypi.org/project/django-sql-explorer/5.2b1/

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

No branches or pull requests

2 participants