[JBoss] New Keycloak image with own changes crashes directly

Discussão em 'StackOverflow' iniciado por Stack, Setembro 1, 2021.

  1. Stack

    Stack Membro Participativo

    I have a weird problem with Docker and hope someone here can help me :)

    I want to create a keycloak image that is derived from the image jboss/keycloak. The idea is that in the Dockerfile also a preconfigured standalone.xml is copied into the image and keycloak can start directly without manual work.

    But as soon as I write for example a

    "CMD touch /opt/test.txt"


    into the file the container crashes with the message "12:02:14,290 INFO [org.jboss.modules] (main) JBoss Modules version 1.9.1.Final WFLYSRV0073: Invalid option '/bin/sh'"

    This is just a new file with no purpose, the changes to the .xml are not in there yet.

    As soon as I put only the FROM back in and rebuild everything works again.

    I thought through the layers in the container you could mod an image, but here it doesn't seem to work. Can someone tell me why ?

    So far it has always worked with the alpine image, but I don't want to build the whole keycloak setup again myself, when there is already an official image for it.

    This is basically what I had in mind:

    FROM jboss/keycloak:X.XX
    CMD rm /opt/jboss/keycloak/standalone/configuration/standalone.xml
    COPY ./keycloak/standalone.xml /opt/jboss/keycloak/standalone/configuration/


    Thanks for help :)

    Continue reading...

Compartilhe esta Página