Builder of Docker image with Redis using "Distroless" Docker Image as a base image.
- JDK 1.8+
- Docker 1.12+
- If remote Docker instance is used then
DOCKER_HOST
environment variable should point to that engine and include the schema, liketcp://docker-host:2375
instead ofdocker-host:2375
. - The current directory is a directory where this repository is cloned.
Building with Maven Wrapper:
./mvnw clean package
or on Windows:
mvnw.cmd clean package
-
Redis version
docker run --rm abrarov/redis:6.2.6-1.2.0
Expected output looks like:
Redis server v=6.2.6 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=deb580d722d23776
-
container_id="$(docker run -d abrarov/redis:6.2.6-1.2.0 redis-server)" && \ docker exec "${container_id}" redis-cli ping && \ docker rm -fv "${container_id}" > /dev/null
Expected output is:
PONG
-
j2cli version
docker run --rm abrarov/j2cli:0.3.10-1.2.0
Expected output is:
j2cli 0.3.10, Jinja2 2.11.3
Assuming the current directory is a directory where this repository is cloned.
-
Start
docker-compose -p redis up -d
-
Test connection to Redis
docker run --rm --network redis_default abrarov/redis:6.2.6-1.2.0 redis-cli -h redis ping
Expected output is:
PONG
-
Put some data into Redis
docker run --rm --network redis_default abrarov/redis:6.2.6-1.2.0 redis-cli -h redis set foo bar
Expected output is:
OK
-
Stop without removal
docker-compose -p redis stop -t 120
-
Start stopped instances
docker-compose -p redis start
-
Test persistence of stored data
docker run --rm --network redis_default abrarov/redis:6.2.6-1.2.0 redis-cli -h redis get foo
Expected output is:
bar
-
Stop immediately and remove
docker-compose -p redis down -v -t 0