explorerhq / sql-explorer

SQL reporting that Just Works. Fast, simple, and confusion-free. Write and share queries in a delightful SQL editor, with AI assistance.
https://www.sqlexplorer.io
Other
2.74k stars 363 forks source link

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

Closed FreedomBen closed 1 month ago

FreedomBen commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

@FreedomBen should be fixed here:

https://github.com/explorerhq/sql-explorer/pull/662

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

FreedomBen commented 1 month ago

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

It works!

chrisclark commented 1 month ago

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

chrisclark commented 1 month ago

Released in 5.2b1:

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