Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker file not working #2

Open
MaltePetersen opened this issue Sep 21, 2019 · 4 comments
Open

Docker file not working #2

MaltePetersen opened this issue Sep 21, 2019 · 4 comments

Comments

@MaltePetersen
Copy link

I get the following error if I try to run the docker compose image:
ERROR: Service 'idm-keycloak' failed to build: COPY failed: no source files were specified
What can I do to resolve this?

PS C:\Users\peter\Desktop\keycloak-docker-demo-master\idm-system> docker-compose up
Building idm-keycloak
Step 1/32 : FROM jboss/keycloak:7.0.0
---> 0e016c61a36f
Step 2/32 : ENV KEYCLOAK_ADMIN_USER admin
---> Using cache
---> 0a6b3ad8a5e9
Step 3/32 : ENV KEYCLOAK_ADMIN_PASSWORD admin
---> Using cache
---> acf093e284c3
Step 4/32 : ENV LOG_SERVER_URL udp:graylog
---> Using cache
---> 25c6cda920fc
Step 5/32 : ENV LOG_SERVER_PORT 12123
---> Using cache
---> 49383f8e1f80
Step 6/32 : ENV JDBC_URL JDBC_URL=jdbc:postgresql://sso-db/idm_keycloak_demo
---> Using cache
---> 43a5a240f5b3
Step 7/32 : ENV JDBC_USER keycloak
---> Using cache
---> 604847fd7876
Step 8/32 : ENV JDBC_PASSWORD keycloak
---> Using cache
---> 780cd7081d8e
Step 9/32 : ENV JDBC_DRIVERNAME postgres
---> Using cache
---> 0d847dbb744a
Step 10/32 : ENV ACTIVE_MQ_USER idm
---> Using cache
---> 72f0892460ec
Step 11/32 : ENV ACTIVE_MQ_PASSWORD idm
---> Using cache
---> d97bd5481b50
Step 12/32 : ENV ACTIVE_MQ_URL tcp://sso-amq:61616
---> Using cache
---> 208d389b3b75
Step 13/32 : ENV KEYCLOAK_EVENT_QUEUE idm.queue.keycloak.rawevents
---> Using cache
---> 53f9231c7db3
Step 14/32 : ENV KEYCLOAK_CONTEXT_PATH u/auth
---> Using cache
---> 1b7ae64a8710
Step 15/32 : ENV JAVA_OPTS -Xms128M -Xmx2G -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true
---> Using cache
---> 5eecb222bf73
Step 16/32 : USER root
---> Using cache
---> 4d8667c17709
Step 17/32 : RUN ln -f -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
---> Using cache
---> 0303c95ee0f3
Step 18/32 : USER jboss
---> Using cache
---> 316bba4bd426
Step 19/32 : ADD /modules /opt/jboss/keycloak/modules
---> Using cache
---> f0476f762e14
Step 20/32 : ADD /themes/springio18 /opt/jboss/keycloak/themes/springio18
---> Using cache
---> c5eeee11c927
Step 21/32 : ADD /themes/springio19 /opt/jboss/keycloak/themes/springio19
---> Using cache
---> b18822a74466
Step 22/32 : ADD /themes/wjax18 /opt/jboss/keycloak/themes/wjax18
---> Using cache
---> 9421df5fa1cd
Step 23/32 : COPY keycloak.jks /opt/jboss/keycloak/standalone/configuration
---> Using cache
---> 52d093b8e36b
Step 24/32 : COPY activemq-rar.rar /opt/jboss/keycloak
---> Using cache
---> b646f30a9c75
Step 25/32 : COPY extensions/jms-event-forwarder/target/jms-event-forwarder*.jar /opt/jboss/keycloak/modules/de/tdlabs/keycloak/ext/jms-event-forwarder/main/jms-event-forwarder.jar
ERROR: Service 'idm-keycloak' failed to build: COPY failed: no source files were specified

@jannie-louwrens
Copy link

You need to compile the jms-event-forwarder & user-storage-provider-demo extensions.
In a terminal:

  1. navigate to directory /keycloak-docker-demo/idm-system/keycloak/extensions/jms-event-forwarder
  2. execute: mvn clean package
  3. navigate to directory /keycloak-docker-demo/idm-system/keycloak/extensions/user-storage-provider-demo
  4. execute: mvn clean package

@titobundy
Copy link

titobundy commented Aug 20, 2020

After compile 2 prevoius artifacts in extensions folder, How can I deploy all pieces?, when I run docker compose the keycloak container never starts or is up only for a momment.

idm-system_elasticsearch_1   /docker-entrypoint.sh elas ...   Up       127.0.0.1:9200->9200/tcp, 9300/tcp                                              
idm-system_grafana_1         /run.sh                          Up       0.0.0.0:3000->3000/tcp                                                          
idm-system_graylog_1         /docker-entrypoint.sh graylog    Up       127.0.0.1:12123->12123/udp, 127.0.0.1:12124->12124/tcp, 127.0.0.1:9000->9000/tcp
idm-system_idm-amq_1         /bin/sh -c bin/activemq co ...   Up       1883/tcp, 5672/tcp, 61613/tcp, 61614/tcp, 61616/tcp, 127.0.0.1:8161->8161/tcp   
idm-system_idm-db_1          docker-entrypoint.sh postgres    Up       127.0.0.1:55432->5432/tcp                                                       
idm-system_idm-keycloak_1    /opt/jboss/tools/docker-en ...   Exit 1                                                                                   
idm-system_mailserver_1      MailHog                          Up       127.0.0.1:1025->1025/tcp, 127.0.0.1:8025->8025/tcp                              
idm-system_mongo_1           docker-entrypoint.sh mongod      Up       27017/tcp  

Container logs error

22:06:30,679 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "microprofile-metrics-smallrye")]): java.lang.NullPointerException
	at [email protected]//org.wildfly.extension.microprofile.metrics.MicroProfileMetricsSubsystemAdd$2.execute(MicroProfileMetricsSubsystemAdd.java:86)
	at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
	at [email protected]//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743)
	at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
	at [email protected]//org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1413)
	at [email protected]//org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:527)
	at [email protected]//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:515)
	at [email protected]//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:477)
	at [email protected]//org.jboss.as.server.ServerService.boot(ServerService.java:448)
	at [email protected]//org.jboss.as.server.ServerService.boot(ServerService.java:401)
	at [email protected]//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:416)
	at java.base/java.lang.Thread.run(Thread.java:834)

Docker Version: 18.09.5
docker-compose version 1.24.0, build 0aa59064

@ammad27k
Copy link

@thomasdarimont @jannie-louwrens I am facing the same issue which @titobundy posted. I think this is because h2 database is being used instead of postgreSQL

| 15:58:53,398 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 67) HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
idm-keycloak_1 | 15:58:53,404 WARN [org.hibernate.dialect.H2Dialect] (ServerService Thread Pool -- 67) HHH000431: Unable to determine H2 database version, certain features may not work
idm-keycloak_1 | 15:58:53,450 INFO [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool -- 67) Envers integration enabled? : true
idm-keycloak_1 | 15:58:54,184 INFO [org.hibernate.orm.beans] (ServerService Thread Pool -- 67) HHH10005002: No explicit CDI BeanManager reference was passed to Hibernate, but CDI is available on the Hibernate ClassLoader.
idm-keycloak_1 | 15:58:54,341 INFO [org.hibernate.validator.internal.util.Version] (ServerService Thread Pool -- 67) HV000001: Hibernate Validator 6.0.20.Final
idm-keycloak_1 | 15:58:56,304 INFO [org.hibernate.hql.internal.QueryTranslatorFactoryInitiator] (ServerService Thread Pool -- 67) HHH000397: Using ASTQueryTranslatorFactory
idm-keycloak_1 | 15:58:57,001 INFO [org.keycloak.services] (ServerService Thread Pool -- 67) KC-SERVICES0050: Initializing master realm
idm-keycloak_1 | 15:58:58,311 INFO [org.keycloak.services] (ServerService Thread Pool -- 67) KC-SERVICES0006: Importing users from '/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json'
idm-keycloak_1 | 15:58:59,141 INFO [org.keycloak.services] (ServerService Thread Pool -- 67) KC-SERVICES0009: Added user 'admin' to realm 'master'
idm-keycloak_1 | 15:58:59,148 INFO [org.keycloak.services] (ServerService Thread Pool -- 67) KC-SERVICES0034: Export of realm 'acme' requested.
idm-keycloak_1 | 15:58:59,148 INFO [org.keycloak.exportimport.singlefile.SingleFileExportProvider] (ServerService Thread Pool -- 67) Exporting realm 'acme' into file /opt/jboss/keycloak/impexp/acme-realm.json
idm-keycloak_1 | 15:58:59,161 FATAL [org.keycloak.services] (ServerService Thread Pool -- 67) Error during startup: java.lang.NullPointerException
idm-keycloak_1 | at [email protected]//org.keycloak.models.utils.ModelToRepresentation.toRepresentation(ModelToRepresentation.java:325)
idm-keycloak_1 | at [email protected]//org.keycloak.exportimport.util.ExportUtils.exportRealm(ExportUtils.java:93)
idm-keycloak_1 | at [email protected]//org.keycloak.exportimport.util.ExportUtils.exportRealm(ExportUtils.java:89)
idm-keycloak_1 | at [email protected]//org.keycloak.exportimport.singlefile.SingleFileExportProvider$2.runExportImportTask(SingleFileExportProvider.java:83)
idm-keycloak_1 | at [email protected]//org.keycloak.exportimport.util.ExportImportSessionTask.run(ExportImportSessionTask.java:35)
idm-keycloak_1 | at [email protected]//org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:227)
idm-keycloak_1 | at [email protected]//org.keycloak.exportimport.singlefile.SingleFileExportProvider.exportRealm(SingleFileExportProvider.java:78)
idm-keycloak_1 | at [email protected]//org.keycloak.exportimport.ExportImportManager.runExport(ExportImportManager.java:105)
idm-keycloak_1 | at [email protected]//org.keycloak.services.resources.KeycloakApplication.startup(KeycloakApplication.java:147)
idm-keycloak_1 | at [email protected]//org.keycloak.provider.wildfly.WildflyPlatform.onStartup(WildflyPlatform.java:29)
idm-keycloak_1 | at [email protected]//org.keycloak.services.resources.KeycloakApplication.(KeycloakApplication.java:114)
idm-keycloak_1 | at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
idm-keycloak_1 | at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
idm-keycloak_1 | at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
idm-keycloak_1 | at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
idm-keycloak_1 | at [email protected]//org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:152)
idm-keycloak_1 | at [email protected]//org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2811)
idm-keycloak_1 | at [email protected]//org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:371)
idm-keycloak_1 | at [email protected]//org.jboss.resteasy.spi.ResteasyDeployment.startInternal(ResteasyDeployment.java:283)
idm-keycloak_1 | at [email protected]//org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:93)
idm-keycloak_1 | at [email protected]//org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:140)
idm-keycloak_1 | at [email protected]//org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:42)
idm-keycloak_1 | at [email protected]//io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
idm-keycloak_1 | at [email protected]//org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
idm-keycloak_1 | at [email protected]//io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
idm-keycloak_1 | at [email protected].

@thomasdarimont
Copy link
Owner

Hi there,

this example is outdated and no longer maintained.
Take a look at https://github.com/thomasdarimont/keycloak-project-example for a more recent example.

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

No branches or pull requests

5 participants