Derived from the "port" by Adam Miller email@example.com from https://github.com/fedora-cloud/Fedora-Dockerfiles
Originally written for Fedora-Dockerfiles by Stephen Tweedie firstname.lastname@example.org
What is Redis?
Redis is often referred as a data structures server. What this means is that Redis provides access to mutable data structures via a set of commands, which are sent using a server-client model with TCP sockets and a simple protocol. So different processes can query and modify the same data structures in a shared way.
Data structures implemented into Redis have a few special properties:
- Redis cares to store them on disk, even if they are always served and modified into the server memory. This means that Redis is fast, but that is also non-volatile.
- Implementation of data structures stress on memory efficiency, so data structures inside Redis will likely use less memory compared to the same data structure modeled using an high level programming language.
- Redis offers a number of features that are natural to find in a database, like replication, tunable levels of durability, cluster, high availability.
Another good example is to think of Redis as a more complex version of memcached, where the operations are not just SETs and GETs, but operations to work with complex data types like Lists, Sets, ordered data structures, and so forth.
If you want to know more, this is a list of selected starting points:
- Introduction to Redis data types. http://redis.io/topics/data-types-intro
- Try Redis directly inside your browser. http://try.redis.io
- The full list of Redis commands. http://redis.io/commands
- There is much more inside the Redis official documentation. http://redis.io/documentation
Building and Running the Container
Copy the sources down -
# docker build -rm -t <username>/redis:clefos7 .
# docker run -d -p 6379:6379 brunswickheads/redis-2.8.19-s390x:latest
Playing with Redis
You can use redis-cli to play with Redis. Start a redis-server container, then in another terminal try the following:
# docker exec -i -t redis redis-cli 127.0.0.1:6379> ping PONG 127.0.0.1:6379> set foo bar OK 127.0.0.1:6379> get foo "bar" 127.0.0.1:6379> incr mycounter (integer) 1 127.0.0.1:6379> incr mycounter (integer) 2 127.0.0.1:6379>
You can find the list of all the available commands at http://redis.io/commands.