-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 documentation #2623
Docker documentation #2623
Conversation
👷 Deploy request for redis-doc pending review.Visit the deploys page to approve it
|
2. If you want to persist your RedisInsight data, make sure that the user inside the container has the necessary permissions on the mounted volume (`/db` in the example below) | ||
|
||
```bash | ||
docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest -v redisinsight:/db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the command should be docker run -d --name redisinsight -p 5540:5540 redis/redisinsight:latest -v redisinsight:/data
Interesting part is here -v redisinsight:/data
. Where redisinsight
- path to folder on machine when /data
- path inside docker container
Also since RedisInsight docker container runs under node
user it is important to create the redisinsight (or any other name)
folder before run docker run
command so there will be no permissions issues.
Here is explanation from stackoberflow:
With the host volumes, they are Linux bind mount with an extra feature. Normally with a bind mount, the source directory must already exist. But to improve usability, docker will create this directory for you if it doesn't already exist. It does that from the daemon, that's running as root.
While it may be useful to configure that folder as your current user, there are several challenges. First, the daemon doesn't necessarily know that uid/gid, it's not part of the rest API. Also the daemon isn't necessarily running on your local host, it may be an API call to a remote host. And the user on your host doesn't necessarily match the user in the container.
The ideal solution is to create the directory in advance with the needed permissions and ownership. Or you can switch to named volumes, which have a convenient feature where docker will copy the contents of the image at that location to initialize the volume, including ownership and permissions (this happens when the volume is empty and the container is being created, so it does not receive updates when you have a new image). One last option is to start your container as root, but fix the permissions with an entrypoint script, and then use a command like gosu to change to a non-root user to run the app.```
adding the health check
Initial documentation for RedisInsight on docker.
Do not merge it for now.