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

Run Graphdb as different user then root #5

Open
phlegx opened this issue Mar 5, 2019 · 5 comments
Open

Run Graphdb as different user then root #5

phlegx opened this issue Mar 5, 2019 · 5 comments

Comments

@phlegx
Copy link

phlegx commented Mar 5, 2019

Would be nice to have Graphdb running as a different user then root. This is actually docker best practice.

@stefanbischof
Copy link

I'm currently creating my own Docker image with this simple Dockerfile (tag is a build argument which has to be set when running docker build):

FROM ontotext/graphdb:${tag}

RUN chown -R nobody /opt/graphdb
USER nobody

Maybe the USER command could be easily integrated into the official Dockerfile? Then we wouldn't need the chown shell command anymore.

@ThomasThelen
Copy link

+1 for this, especially since it's common for people to expose sparql endpoints to the open world. This opens up a direct route to a service in the container with elevated privs

@bkis
Copy link

bkis commented Sep 30, 2024

If you're using docker compose, it seems to work to do the following:

services:
  graphdb:
    image: "ontotext/graphdb:${WHATEVER_VERSION_YOU_USE}"
    volumes:
      - "./data:/opt/graphdb/home"
    user: 2222:2222
    # ...

... and chown ./data to 2222:2222, of course.

@stefanbischof
Copy link

Thank you for the hint, that looks promising. I'll try that. I still think this should be done in the Dockerfile.

@bkis
Copy link

bkis commented Oct 2, 2024

Thank you for the hint, that looks promising. I'll try that. I still think this should be done in the Dockerfile.

Absolutely.

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

4 participants