Sign inSign up

11notes/redis

By 11notes

β€’Updated 2 days ago

run redis rootless and distroless

Buildkit cache
Image
Databases & storage
1

10K+

11notes/redis repository overview

banner

⁠REDIS

size5pxpulls5px5pxswiss_made

run redis rootless and distroless

⁠INTRODUCTION πŸ“’

For developers, who are building real-time data-driven applications, Redis is the preferred, fastest, and most feature-rich cache, data structure server, and document and vector query engine.

REDISINSIGHT

⁠SYNOPSIS πŸ“–

What can I do with this? This image will run redis rootless⁠ and distroless⁠ for more security. Besides being more secure and slim than most images, it also offers additional start parameters to either start Redis in command mode, as a replica or as a in-memory database that persists nothing to disk. Simply provide the command needed:

⁠COMMANDS πŸ“Ÿ

  • --cmd - Will execute all commands against the Redis database specified via REDIS_HOST environment variable
  • --replica MASTER - Will start as replica from MASTER (can be IP, FQDN or container DNS)
  • --in-memory - Will start Redis only in memory
  • 1⁠ - ... and more?

⁠UNIQUE VALUE PROPOSITION πŸ’Ά

Why should I run this image and not the other image(s) that already exist? Good question! Because ...

  • ... this image runs rootless⁠ as 1000:1000
  • ... this image has no shell since it is distroless⁠
  • ... this image is auto updated to the latest version via CI/CD
  • ... this image has a health check
  • ... this image runs read-only
  • ... this image is automatically scanned for CVEs before and after publishing
  • ... this image is created via a secure and pinned CI/CD process
  • ... this image runs a basic integration test before it will be published (or not if it fails)
  • ... this image is very small
  • ... this image can be used to execute commands after redis has started

If you value security, simplicity and optimizations to the extreme, then this image might be for you.

⁠COMPARISON 🏁

Below you find a comparison between this image and the most used or original one.

imagesize on diskinit default asdistroless⁠supported architectures
11notes/redis21MB1000:1000βœ…amd64, arm64, armv7
redis146MB0:0❌386, amd64, arm64v8, armv5, armv7, ppc64le, riscv64, s390x

⁠VOLUMES πŸ“

  • /redis/etc - Directory of your redis.conf
  • /redis/var - Directory of your redis data

⁠COMPOSE βœ‚οΈ

Checkout compose.secrets.yml⁠ if you want to use secrets instead of environment variables.

name: "kv"

x-lockdown: &lockdown
  # prevents write access to the image itself
  read_only: true
  # prevents any process within the container to gain more privileges
  security_opt:
    - "no-new-privileges=true"

x-image-redis: &image
  image: "11notes/redis:8.10.2"
  <<: *lockdown

services:
  redis:
    <<: *image
    environment:
      REDIS_PASSWORD: "${REDIS_PASSWORD}"
      TZ: "Europe/Zurich"
    networks:
      backend:
    volumes:
      - "redis.etc:/redis/etc"
      - "redis.var:/redis/var"
    tmpfs:
      - "/run:uid=1000,gid=1000"
    restart: "always"

  # start a replica of redis
  replica:
    <<: *image
    environment:
      REDIS_PASSWORD: "${REDIS_PASSWORD}"
      TZ: "Europe/Zurich"
    command: "--replica redis"
    networks:
      backend:
    volumes:
      - "replica.etc:/redis/etc"
      - "replica.var:/redis/var"
    tmpfs:
      - "/run:uid=1000,gid=1000"
    restart: "always"

  # start Redis only in-memory
  in-memory:
    <<: *image
    environment:
      REDIS_PASSWORD: "${REDIS_PASSWORD}"
      TZ: "Europe/Zurich"
    command: "--in-memory"
    networks:
      backend:
    volumes:
      - "in-memory.etc:/redis/etc"
    tmpfs:
      - "/run:uid=1000,gid=1000"
    restart: "always"

  # execute CLI commands via redis-cli
  cli:
    <<: *image
    depends_on:
      redis:
        condition: "service_healthy"
        restart: true
    environment:
      REDIS_HOST: "redis"
      REDIS_PASSWORD: "${REDIS_PASSWORD}"
      TZ: "Europe/Zurich"
    # start redis in cmd mode
    entrypoint: ["/usr/local/bin/redis", "--cmd"]
    # commands to execute in order
    command: 
      - PING
      - --version
      - SET key value NX
      - GET key
    networks:
      backend:

  # demo container to actually view the databases
  gui:
    image: "redis/redisinsight"
    environment:
      RI_REDIS_HOST0: "redis"
      RI_REDIS_PASSWORD0: "${REDIS_PASSWORD}"
      RI_REDIS_HOST1: "replica"
      RI_REDIS_PASSWORD1: "${REDIS_PASSWORD}"
      RI_REDIS_HOST2: "in-memory"
      RI_REDIS_PASSWORD2: "${REDIS_PASSWORD}"
      TZ: "Europe/Zurich"
    ports:
      - "3000:5540/tcp"
    networks:
      backend:
      frontend:

volumes:
  redis.etc:
  redis.var:
  replica.etc:
  replica.var:
  in-memory.etc:

networks:
  frontend:
  backend:
    internal: true

To find out how you can change the default UID/GID of this container image, consult the RTFM⁠.

⁠DEFAULT SETTINGS πŸ—ƒοΈ

ParameterValueDescription
userdockeruser name
uid1000user identifier⁠
gid1000group identifier⁠
home/redishome directory of user docker

⁠ENVIRONMENT πŸ“

ParameterValueDefault
TZTime Zone⁠
DEBUGWill activate debug option for container image and app (if available)
REDIS_PASSWORDPassword used for authentication
REDIS_PASSWORD_FILE (optional)Secrets file containing the password for authentication (check compose.secrets.yml⁠)
REDIS_IP (optional)IP of Redis server0.0.0.0
REDIS_PORT (optional)Port of Redis server6379
REDIS_HOST (optional)IP of upstream Redis server when using --cmd
REDISCLI_HISTFILE (optional)Disable history of redis-cli (for security)/dev/null

⁠MAIN TAGS 🏷️

These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.

⁠There is no latest tag, what am I supposed to do about updates?

It is my opinion that the :latest tag is a bad habbit and should not be used at all. Many developers introduce breaking changes in new releases. This would messed up everything for people who use :latest. If you don’t want to change the tag to the latest semver⁠, simply use the short versions of semver⁠. Instead of using :8.10.2 you can use :8 or :8.10. Since on each new version these tags are updated to the latest version of the software, using them is identical to using :latest but at least fixed to a major or minor version. Which in theory should not introduce breaking changes.

If you still insist on having the bleeding edge release of this app, simply use the :rolling tag, but be warned! You will get the latest version of the app instantly, regardless of breaking changes or security issues or what so ever. You do this at your own risk!

⁠REGISTRIES ☁️

docker pull 11notes/redis:8.10.2
docker pull ghcr.io/11notes/redis:8.10.2
docker pull quay.io/11notes/redis:8.10.2

⁠UNRAID VERSION 🟠

This image supports unraid by default. Simply add -unraid to any tag and the image will run as 99:100 instead of 1000:1000.

⁠NOBODY VERSION πŸ‘»

This image supports nobody by default. Simply add -nobody to any tag and the image will run as 65534:65534 instead of 1000:1000.

⁠SOURCE πŸ’Ύ

⁠PARENT IMAGE πŸ›οΈ

This image is not based on another image but uses scratch⁠ as the starting layer. The image consists of the following distroless layers that were added:

⁠BUILT WITH 🧰

⁠GENERAL TIPS πŸ“Œ

  • Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS and to protect your endpoints
  • Use Let’s Encrypt DNS-01 challenge to obtain valid SSL certificates for your services

⁠ElevenNotesℒ️

This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the releases⁠ for breaking changes. If you have any problems with using this image simply raise an issue⁠, thanks. If you have a question or inputs please create a new discussion⁠ instead of an issue. You can find all my other repositories on github⁠.

created 18.09.2026, 06:05:17 (CET)

⁠Footnotes

  1. Sentinel mode will follow soon as well as the possibility to change the announce IP and port ↩⁠

Tag summary

Content type

Image

Digest

sha256:6fcd2d842…

Size

18.9 MB

Last updated

2 days ago

docker pull 11notes/redis:8.10.2-unraid