8000 feat(start-keycloak): fallback to podman when docker is not installed by rafik-gassara · Pull Request #1078 · keycloakify/keycloakify · GitHub
[go: up one dir, main page]

Skip to content

feat(start-keycloak): fallback to podman when docker is not installed - #1078

Open
rafik-gassara wants to merge 1 commit into
keycloakify:mainfrom
rafik-gassara:feat/podman-support
Open

rafik-gassara wants to merge 1 commit into
keycloakify:mainfrom
rafik-gassara:feat/podman-support

Conversation

@rafik-gassara
@rafik-gassara rafik-gassara commented Nov 20, 2026 •
Copy link
Copy Markdown

Summary

  • Add getContainerRuntime() in src/bin/start-keycloak/getContainerRuntime.ts to detect docker first (preserving podman-docker shim support) and fall back to podman when docker is not installed.
  • Update start-keycloak, getRealmConfig / dumpContainerConfig, and scripts/dump-keycloak-realm.ts to use the detected container runtime instead of hardcoding docker.
  • Tailor missing-runtime / daemon-not-running error messages for both Docker and Podman.
  • Add unit tests in test/bin/start-keycloak/getContainerRuntime.spec.ts.

Testing

  • npm run test:types
  • npm run build
  • vitest run (5 test files, 34 tests passed)
  • Tested keycloakify start-keycloak --keycloak-version 26.8.2 end-to-end against keycloakify-starter using Podman 6.1.4 on Windows (no Docker installed).

Summary by CodeRabbit

  • New Features
    • Keycloak can now be started using either Docker or Podman, with the available runtime selected automatically.
    • Startup instructions and error messages reflect the selected runtime, and realm configuration backups work with either option.

@coderabbitai
coderabbitai Bot commented Nov 20, 2026 •
Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The startup command and realm-dump script now detect Docker or Podman and use the selected runtime for container operations. Realm configuration backup passes the runtime through to database copying, realm export, cleanup, and realm-file copying. Tests cover runtime detection results.

Changes: Container Runtime Support

Layer / File(s) Summary
Runtime detection and startup
src/bin/start-keycloak/getContainerRuntime.ts, src/bin/start-keycloak/start-keycloak.ts, test/bin/start-keycloak/getContainerRuntime.spec.ts
The new detection function checks Docker, then Podman. The startup command uses the selected runtime for its availability check, container cleanup, displayed run command, and container launch. Tests cover matching output, command failures, and unrecognized output.
Runtime propagation through realm backup
src/bin/start-keycloak/realmConfig/realmConfig.ts, src/bin/start-keycloak/realmConfig/dumpContainerConfig.ts
getRealmConfig passes the selected runtime to dumpContainerConfig. Database copying, realm export, temporary data cleanup, and realm-file copying use that runtime. Failure messages name the configured runtime.
Standalone realm-dump runtime
scripts/dump-keycloak-realm.ts
The script requires Docker or Podman and uses the selected runtime to inspect the Keycloak container and dump its configuration.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Start as start-keycloak command
  participant Detector as getContainerRuntime
  participant Docker
  participant Podman
  participant Runtime as selected runtime CLI
  participant RealmConfig as getRealmConfig
  participant Dump as dumpContainerConfig
  Start->>Detector: Detect available runtime
  Detector->>Docker: Run --version
  Docker-->>Detector: Return output or command failure
  Detector->>Podman: Check if Docker does not match
  Podman-->>Detector: Return output or command failure
  Detector-->>Start: Return docker, podman, or undefined
  Start->>Runtime: Run info, cleanup, and container launch commands
  Start->>RealmConfig: Pass selected runtime
  RealmConfig->>Dump: Pass selected runtime for backup
  Dump->>Runtime: Copy database, export realm, clean up, and copy realm file
Loading

Suggested reviewers: garronej, mkreu

Merge Risk: Minimal · up to bd79f

This change lets the Keycloak startup and realm-dump commands use Podman when Docker is not installed, while keeping Docker, including the podman-docker shim, preferred. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: start-keycloak now falls back to Podman when Docker is not installed. The changeset adds getContainerRuntime(), which checks Docker first and then Podman, and threads …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: start-keycloak now falls back to Podman when Docker is not installed. The changeset adds getContainerRuntime(), which checks Docker first and then Podman, and threads the selected runtime through start-keycloak, getRealmConfig, dumpContainerConfig, and scripts/dump-keycloak-realm.ts. The title is specific and matches the PR objectives. The conventional-commit prefix is acceptable and does not make the title noisy.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 41b8e7d1-63f9-491a-aa0d-37a89ed5f738
Commits

Reviewing files that changed from the base of the PR and between 5db584c and bd79f43.

Files selected for processing: 6

  • scripts/dump-keycloak-realm.ts
  • src/bin/start-keycloak/getContainerRuntime.ts
  • src/bin/start-keycloak/realmConfig/dumpContainerConfig.ts
  • src/bin/start-keycloak/realmConfig/realmConfig.ts
  • src/bin/start-keycloak/start-keycloak.ts
  • test/bin/start-keycloak/getContainerRuntime.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0