Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ RUN cp $QLEVER_PROFILE /qlever/.bashrc
# sourced. The `PATH` is set again to avoid a warning from `pipx`.
USER qlever
ENV PATH=/qlever:/qlever/.local/bin:$PATH
RUN pipx install qlever
RUN pipx install qlever==0.5.35
ENV QLEVER_ARGCOMPLETE_ENABLED=1
ENV QLEVER_IS_RUNNING_IN_CONTAINER=1

Expand Down
20 changes: 7 additions & 13 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,19 @@

# Help message that is printed if the container is not startes as recommended.
HELP_MESSAGE='
The recommended way to run a container with this image is as follows. Run in a fresh directory. Add `-p <outside port>:<inside port>` if you want to expose ports. Inside the container, the `qlever` command-line tool is available, as well as the QLever binaries (which you need not call directly, they are called by the various `qlever` commands).
The recommended way to use this image is with the `qlever` command-line tool, which can be installed with `pip install qlever`, `pipx install qlever`, or `uv tool install qlever`. Commands like `qlever index` or `qlever start` use the QLever Docker image by default (and will pull the right image if necessary).
Copy link
Collaborator

Choose a reason for hiding this comment

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

will pull the right image if necessary

For some users it might be confusing that if a qlever:latest image already exists locally (regardless of age) no new image is pulled and they have to pull it manually if they want a more up-to-date version.


In batch mode (user `qlever` inside the container, with the same UID and GID as outside):
Alternatively, the `qlever` command-line tool is also available inside of the container. For example, you can run (with user `qlever` inside the container, with the same UID and GID as the calling user):

\x1b[34mdocker run -it --rm -e UID=$(id -u) -e GID=$(id -g) -v $(pwd):/data -w /data qlever -c "qlever setup-config olympics && qlever get-data && qlever index"\x1b[0m
\x1b[34mdocker run -it --rm -e UID=$(id -u) -e GID=$(id -g) -v $(pwd):/data -w /data adfreiburg/qlever -c "qlever setup-config olympics && qlever get-data && qlever index"\x1b[0m

The same, but in interactive mode:
The same, but opening an interactive shell inside of the container:

\x1b[34mdocker run -it --rm -e UID=$(id -u) -e GID=$(id -g) -v $(pwd):/data -w /data qlever\x1b[0m
\x1b[34mdocker run -it --rm -e UID=$(id -u) -e GID=$(id -g) -v $(pwd):/data -w /data adfreiburg/qlever\x1b[0m

It also works with `-u $(id -u):$(id -g)` (but then the user inside the container has no proper name):
If you do not care about the user inside of the container, you can also use `-u $(id -u):$(id -g)` instead of `-e UID=... -e GID=...` (then the user inside of the container has no proper name) or omit this part (then the user inside of the container is `root`).

\x1b[34mdocker run -it --rm -u $(id -u):$(id -g) -v $(pwd):/data -w /data qlever\x1b[0m
\x1b[34mdocker run -it --rm -u $(id -u):$(id -g) -v $(pwd):/data -w /data qlever -c "..."\x1b[0m

With podman you should use `-u $(id -u):$(id -g)` together with `--userns=keep-id`:

\x1b[34mpodman run -it --rm -u $(id -u):$(id -g) --userns=keep-id -v $(pwd):/data -w /data qlever\x1b[0m
\x1b[34mpodman run -it --rm -u $(id -u):$(id -g) --userns=keep-id -v $(pwd):/data -w /data qlever -c "..."\x1b[0m
With podman you should use `-u $(id -u):$(id -g)` together with `--userns=keep-id`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's nice that this is documented, but why does it matter to me as a regular user if my user is root, some number or my username?

'

# If the container is run without `-v ...:/data -w /data` (in particular, without
Expand Down
Loading