redis / riot

🧨 Get data in & out of Redis with RIOT

Home Page:http://redis.github.io/riot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating Docker Container for RIOT

ajeetraina opened this issue · comments

It would be great to create Docker container for RIOT.

As a start, I played around with creating a simple Dockerfile for riot-redis obtaining the release binaries instead of having to build it from source:

FROM openjdk:8-jre-alpine3.9
ARG VERSION

RUN apk update
RUN apk add unzip wget

RUN wget https://github.com/redis-developer/riot/releases/download/v${VERSION}/riot-redis-${VERSION}.zip
RUN unzip riot-redis-${VERSION}.zip
WORKDIR /riot-redis-${VERSION}/bin/

CMD ["sh", "-c", "./riot-redis"]

You'd build this with:

VERSION=2.2.7 docker build . --build-arg VERSION=$VERSION -t redis-developer/riot-redis:$VERSION

@zucaritask

Thanks for your time in building this Dockerfile. Tested your Dockerfile few minutes back and it looks cool.

docker build --build-arg VERSION=2.2.7 -t ajeetraina/riot-redis .
docker run ajeetraina/riot-redis:latest ./riot-redis
Usage: riot-redis [OPTIONS] [COMMAND]
      --help                Show this help message and exit.
  -V, --version             Print version information and exit.
  -q, --quiet               Log errors only
  -d, --debug               Log in debug mode (includes normal stacktrace)
  -i, --info                Set log level to info
Redis connection options
  -h, --hostname=<host>     Server hostname (default: 127.0.0.1)
  -p, --port=<port>         Server port (default: 6379)
  -s, --socket=<socket>     Server socket (overrides hostname and port)
      --user=<username>     Used to send ACL style 'AUTH username pass'. Needs
                              password.
  -a, --pass[=<password>]   Password to use when connecting to the server
  -u, --uri=<uri>           Server URI
  -o, --timeout=<sec>       Redis command timeout (default: 60)
  -n, --db=<int>            Database number (default: 0)
  -c, --cluster             Enable cluster mode
  -t, --tls                 Establish a secure TLS connection
      --no-verify-peer      Do not verify peers when using TLS
  -l, --latency             Show latency metrics
  -m, --pool=<int>          Max pool connections (default: 8)
Commands:
  replicate, r  Replicate a source Redis database in a target Redis database
  info, i       Display INFO command output
  latency, l    Calculate latency stats
  ping, p       Execute PING command
[node1] (local) root@192.168.0.28 ~

Thanks for the starting point. Here's an updated version to work with latest:

FROM openjdk:11.0-jre

ARG VERSION

RUN wget https://github.com/redis-developer/riot/releases/download/v${VERSION}/riot-redis-${VERSION}.zip && unzip riot-redis-${VERSION}.zip
WORKDIR /riot-redis-${VERSION}/bin/

ENTRYPOINT ["./riot-redis"]

@dkong Thanks. Would love to know more about how you are using RIOT in your infrastructure? Are you using it just for migration?

Docker images are now published for every release: https://developer.redis.com/riot/riot-redis/#_docker