项目结构

自定义SPI注册

1. 直接复制文件方式

docker cp keycloak-service-self-spi.jar keycloak:/opt/docker cp module-one-add.cli keycloak:/opt/docker exec -it keycloak bash$JBOSS_HOME/bin/jboss-cli.sh --file=/opt/module-one-add.cli

使用docker commit保存你当前容器为一个新的镜像,然后启动它即可

2. 打包镜像方式

Dockerfile

FROM jboss/keycloak:11.0.3USER root#self providerWORKDIR /optCOPY target/keycloak-service-self-spi.jar .RUN mkdir cliCOPY module-one-add.cli cli/RUN $JBOSS_HOME/bin/jboss-cli.sh --file=cli/module-one-add.cliRUN rm -rf $JBOSS_HOME/standalone/configuration/standalone_