Search code examples
dockerkeycloakdocker-multi-stage-build

Keycloak docker image add additional application


I have to extend the keycloak docker image for some additional applications like curl and jq. But the image quay.io/keycloak/keycloak hasn't any package manager installed and I can't find which base image was used for building.

My approach is to use a multistage build. But it doesn't work because I don't know from which base image was derived.

FROM fedora as builder
RUN dnf update -y && dnf install -y curl
FROM quay.io/keycloak/keycloak:latest
COPY --from=builder /usr/bin/curl /bin/curl

Someone an idea how can I install the application in the keycloak docker image? Or is anywhere the git repository for the actual keycloak image?

Thank you.


Solution

  • The right way is described here: container config

    FROM registry.access.redhat.com/ubi9 AS ubi-micro-build
    RUN mkdir -p /mnt/rootfs
    RUN dnf install --installroot /mnt/rootfs jq curl \
        --releasever 9 --setopt install_weak_deps=false --nodocs -y; \
        dnf --installroot /mnt/rootfs clean all