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 documentation #2623

Merged
merged 45 commits into from
Jan 31, 2024
Merged

Conversation

ViktarStarastsenka
Copy link
Contributor

@ViktarStarastsenka ViktarStarastsenka commented Dec 11, 2023

Initial documentation for RedisInsight on docker.
Do not merge it for now.

Copy link

netlify bot commented Dec 11, 2023

👷 Deploy request for redis-doc pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9563f33

docs/install/install-redisinsight/env-variables.md Outdated Show resolved Hide resolved
docs/install/install-redisinsight/env-variables.md Outdated Show resolved Hide resolved
docs/install/install-redisinsight/env-variables.md Outdated Show resolved Hide resolved
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

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.```

docs/install/install-redisinsight/install-on-docker.md Outdated Show resolved Hide resolved
docs/install/install-redisinsight/install-on-k8s.md Outdated Show resolved Hide resolved
docs/install/install-redisinsight/install-on-k8s.md Outdated Show resolved Hide resolved
docs/install/install-redisinsight/install-on-k8s.md Outdated Show resolved Hide resolved
docs/install/install-redisinsight/install-on-k8s.md Outdated Show resolved Hide resolved
@dwdougherty dwdougherty merged commit 6895f84 into redis:master Jan 31, 2024
1 check failed
@ViktarStarastsenka ViktarStarastsenka deleted the docker-documentation branch January 31, 2024 20:20
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

Successfully merging this pull request may close these issues.

3 participants