Sign inSign up

11notes/keycloak

By 11notes

โ€ขUpdated 3 days ago

run Keycloak rootless and distroless

Buildkit cache
Image
0

5.1K

11notes/keycloak repository overview

banner

โ KEYCLOAK

size5pxpulls5px5pxswiss_made

run Keycloak rootless and distroless

โ INTRODUCTION ๐Ÿ“ข

Keycloak provides user federation, strong authentication, user management, fine-grained authorization, and more.

LOGIN

โ SYNOPSIS ๐Ÿ“–

What can I do with this? This image will run Keycloak rootlessโ  and distrolessโ  for more security.

โ 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 is very small

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/keycloak303MB1000:1000โœ…amd64, arm64
keycloak/keycloak477MB1000:0โŒamd64, arm64, ppc64le

โ VOLUMES ๐Ÿ“

  • /keycloak/etc - Directory of your Keycloak configs

โ COMPOSE โœ‚๏ธ

name: "idp"

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

services:
  keycloak:
    depends_on:
      postgres:
        condition: "service_healthy"
        restart: true
    image: "11notes/keycloak:26.7.4"
    <<: *lockdown
    environment:
      TZ: "Europe/Zurich"
      KC_HOSTNAME: "${KEYCLOAK_FQDN}"
      KC_DB_PASSWORD: "${POSTGRES_PASSWORD}"
      KC_BOOTSTRAP_ADMIN_PASSWORD: "${KEYCLOAK_ADMIN_PASSWORD}"
    tmpfs:
      - "/tmp:uid=1000,gid=1000"
    networks:
      frontend:
      backend:
    ports:
      - "3000:8080/tcp"
      - "9000:9000/tcp"
    restart: "always"

  postgres:
    # for more information about this image checkout:
    # https://github.com/11notes/docker-postgres
    image: "11notes/postgres:18"
    <<: *lockdown
    environment:
      TZ: "Europe/Zurich"
      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
      POSTGRES_BACKUP_SCHEDULE: "0 3 * * *"
    volumes:
      - "postgres.etc:/postgres/etc"
      - "postgres.var:/postgres/var"
      - "postgres.backup:/postgres/backup"
    tmpfs:
      - "/postgres/run:uid=1000,gid=1000"
      - "/postgres/log:uid=1000,gid=1000"
    networks:
      backend:
    restart: "always"

volumes:
  postgres.etc:
  postgres.var:
  postgres.backup:

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/keycloakhome directory of user docker
admintmpadminusername of temporary admin using password KC_BOOTSTRAP_ADMIN_PASSWORD

โ ENVIRONMENT ๐Ÿ“

ParameterValueDefault
TZTime Zoneโ 
DEBUGWill activate debug option for container image and app (if available)
KC_HOSTNAMEFQDN of Keycloak
KC_DB_PASSWORDPostgres password
KC_BOOTSTRAP_ADMIN_PASSWORDPassword of the temporary admin account (tmpadmin)

โ 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 :26.7.4 you can use :26 or :26.7. 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/keycloak:26.7.4
docker pull ghcr.io/11notes/keycloak:26.7.4
docker pull quay.io/11notes/keycloak:26.7.4

โ 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 17.09.2026, 06:09:11 (CET)

Tag summary

Content type

Image

Digest

sha256:9e897eac2โ€ฆ

Size

200.9 MB

Last updated

3 days ago

docker pull 11notes/keycloak:26.7.4-unraid