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

Docker container should not run as root! #45

Open
ghost opened this issue May 28, 2018 · 5 comments
Open

Docker container should not run as root! #45

ghost opened this issue May 28, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented May 28, 2018

Currently the docker container for orientdb runs as root and that means that the user has to grant the container access to the entire filesystem and that is super dangerous. The image should be changed to reuqire a user named orientdb in the group docker to run properly. Then the instructions for install should be updated to say:

  * Create a database user: `sudo useradd -N -r orientdb -g docker -s /sbin/nologin`
  * Create directories: `sudo mkdir -p /var/orientdb/config /var/orientdb/databases /var/orientdb/backup`
  * Change directory ownership `sudo chown -R /var/orientdb`
  * Run OrientDB with docker: 
      docker run -d --name orientdb -p 2424:2424 -p 2480:2480 \
        -v config_path:/var/orientdb/config \
        -v databases_path:/var/orientdb/databases \
        -v backup_path:/var/orientdb/backup \
        -e ORIENTDB_ROOT_PASSWORD=root \
        -e ORIENTDB_NODE_NAME=odb1 \
        orientdb /orientdb/bin/server.sh  -Ddistributed=true
@robfrank
Copy link

I think that this article explains very well how uid/gid are working inside a Docker container and in the host:

https://medium.com/@mccode/understanding-how-uid-and-gid-work-in-docker-containers-c37a01d01cf

The orientDB team can improve the documentation, but more important all the users should understand better how Docker works.

@ghost
Copy link
Author

ghost commented May 30, 2018

I dont understand then what is going on because when I run orientdb it is DEFINITELY running as root and that is a security risk. I was only running the "latest" image in docker which is oddly the 2.2 release, not the 3.0. I believe you have to set USER in the dockerfile.

@ghost
Copy link
Author

ghost commented Jun 1, 2018

I think you should describe an orientDB user as the USER in the dockerfile. Is there a 3.0+ release of the docker version yet?

@MadisonStiefel
Copy link

How do you get past the permissions denied error upon deployment of OrientDB?

@ghost
Copy link
Author

ghost commented Jun 12, 2018

I could only run it without docker.

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