107 lines
3.6 KiB
Groff
107 lines
3.6 KiB
Groff
.TH Redis 6 in\-memory data structure store container image
|
|
.PP
|
|
This container image includes Redis 6 in\-memory data structure store for OpenShift and general usage.
|
|
Users can choose between RHEL, CentOS and Fedora based images.
|
|
The RHEL images are available in the Red Hat Container Catalog
|
|
\[la]https://access.redhat.com/containers/\[ra],
|
|
the CentOS images are available on Docker Hub
|
|
\[la]https://hub.docker.com/r/centos/\[ra],
|
|
and the Fedora images are available in Fedora Registry
|
|
\[la]https://registry.fedoraproject.org/\[ra]\&.
|
|
The resulting image can be run using podman
|
|
\[la]https://github.com/containers/libpod\[ra]\&.
|
|
|
|
.PP
|
|
Note: while the examples in this README are calling \fB\fCpodman\fR, you can replace any such calls by \fB\fCdocker\fR with the same arguments
|
|
|
|
.SH Description
|
|
.PP
|
|
Redis 6 available as container, is an advanced key\-value store.
|
|
It is often referred to as a data structure server since keys can contain strings, hashes, lists,
|
|
sets and sorted sets. You can run atomic operations on these types, like appending to a string;
|
|
incrementing the value in a hash; pushing to a list; computing set intersection, union and difference;
|
|
or getting the member with highest ranking in a sorted set. In order to achieve its outstanding
|
|
performance, Redis works with an in\-memory dataset. Depending on your use case, you can persist
|
|
it either by dumping the dataset to disk every once in a while, or by appending each command to a log.
|
|
|
|
.SH Usage
|
|
.PP
|
|
For this, we will assume that you are using the \fB\fCrhel8/redis\-6\fR image.
|
|
If you want to set only the mandatory environment variables and not store
|
|
the database in a host directory, execute the following command:
|
|
|
|
.PP
|
|
.RS
|
|
|
|
.nf
|
|
$ podman run \-d \-\-name redis\_database \-p 6379:6379 rhel8/redis\-6
|
|
|
|
.fi
|
|
.RE
|
|
|
|
.PP
|
|
This will create a container named \fB\fCredis\_database\fR\&. Port 6379 will be exposed and mapped
|
|
to the host.
|
|
|
|
.PP
|
|
If you want your database to be persistent across container executions, also add a
|
|
\fB\fC\-v /host/db/path:/var/lib/redis/data:Z\fR argument. This will be the Redis data directory.
|
|
|
|
.PP
|
|
For protecting Redis data by a password, pass \fB\fCREDIS\_PASSWORD\fR environment variable
|
|
to the container like this:
|
|
|
|
.PP
|
|
.RS
|
|
|
|
.nf
|
|
$ podman run \-d \-\-name redis\_database \-e REDIS\_PASSWORD=strongpassword rhel8/redis\-6
|
|
|
|
.fi
|
|
.RE
|
|
|
|
.PP
|
|
\fBWarning: since Redis is pretty fast an outside user can try up to
|
|
160k passwords per second against a good box. This means that you should
|
|
use a very strong password otherwise it will be very easy to break.\fP
|
|
|
|
.SH Environment variables and volumes
|
|
.PP
|
|
\fB\fB\fCREDIS\_PASSWORD\fR\fP
|
|
.br
|
|
Password for the server access
|
|
|
|
.PP
|
|
You can also set the following mount points by passing the \fB\fC\-v /host:/container:Z\fR flag to podman.
|
|
|
|
.PP
|
|
\fB\fB\fC/var/lib/redis/data\fR\fP
|
|
.br
|
|
Redis data directory
|
|
|
|
.PP
|
|
\fBNotice: When mouting a directory from the host into the container, ensure that the mounted
|
|
directory has the appropriate permissions and that the owner and group of the directory
|
|
matches the user UID or name which is running inside the container.\fP
|
|
|
|
.SH Troubleshooting
|
|
.PP
|
|
Redis logs into standard output, so the log is available in the container log. The log can be examined by running:
|
|
|
|
.PP
|
|
.RS
|
|
|
|
.nf
|
|
podman logs <container>
|
|
|
|
.fi
|
|
.RE
|
|
|
|
.SH See also
|
|
.PP
|
|
Dockerfile and other sources for this container image are available on
|
|
|
|
\[la]https://github.com/sclorg/redis-container\[ra]\&.
|
|
In that repository you also can find another versions of Python environment Dockerfiles.
|
|
Dockerfile for CentOS is called \fB\fCDockerfile\fR, Dockerfile for RHEL7 is called \fB\fCDockerfile.rhel7\fR,
|
|
for RHEL8 it's \fB\fCDockerfile.rhel8\fR and the Fedora Dockerfile is called Dockerfile.fedora.
|