-
Notifications
You must be signed in to change notification settings - Fork 117
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
Problem running Keycloak on Docker container #5310
Comments
Same here with:
|
Also struggling with keycloak, this is on the latest version for the M1 Mac. Errors from the container:
Wondering if this is related to the VPN communication issued described in another post. |
Same error, cannot start keycloak on local machine, no vpn |
In a slack channel I'm part of someone mentioned they had success building the docker image locally and running it. Haven't been able to try it out myself but thought I'd share. They put their image here. Looks like the jboss keycloak may be falling victim to some of the internal unresolved dns issues. |
Ok, went ahead and built the image locally and used that instead in the deployment and it works fine now. Can confirm it works. Hopefully an update comes out soon to the Jboss package. |
@maddoxjack THANK YOU! You have no idea how long I've been looking for a solution haha |
@maddoxjack Do you know if they have published the dockerfile anywhere? I would like to run an older version of Keycloak and only 12 is published on the link above. |
I don't know if they have. You could try asking on the redhat forum for jboss? I posted about this issue on there a while back and they looked into it. |
I guess because the image doesn't support the hosts cpu architecture. Docker released a builderx tool with which I tried to create a keycloak image supporting the linux/arm64. Somehow it's not working for me but anyway after creating the image this could help:
|
After I put |
What KC version did you test @hanksudo ? |
Oops, sorry about that, I was thinking it's a common issue on M1 mac. My case is running go-migrate on docker, and |
I had try on keycloak 13.0.1 with M1 mac. docker run --rm -e DB_ADDR=localhost --platform linux/amd64 -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin quay.io/keycloak/keycloak:13.0.1
docker run --rm -e DB_ADDR=localhost -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin quay.io/keycloak/keycloak:13.0.1 Both of them get the same error
|
https://blog.jaimyn.dev/how-to-build-multi-architecture-docker-images-on-an-m1-mac/#tldr the instructions from this blog helped me |
I was able to run Keycloak on M1 by building docker image locally. I tested this solution on following versions: Steps:
You can also use this script: #/bin/zsh
VERSION=14.0.0 # set version here
cd /tmp
git clone git@github.com:keycloak/keycloak-containers.git
cd keycloak-containers/server
git checkout $VERSION
docker build -t "jboss/keycloak:${VERSION}" .
docker build -t "quay.io/keycloak/keycloak:${VERSION}" . |
thanks @mstanuch . rebulid the Keycloak image on Mac M1 . It works . |
Can someone from the keycloak team please build a keycloak image from mac with m1 chip and upload it to the docker repo, please? |
@mstanuch Thanks for your help! I also was wondering if you were able to find a way for using custom themes on M1 Macbooks? How does that work with the current flow? |
@ialisyed this issue has been reported: AFAIK this issue requires pipeline changes - there is a need to create new docker builder and requires pipeline changes. (I do not have any idea how to do it in this case). @arshiamalek: I was able to do it. It works in the same way as on any other platform. (tldr; mount/copy dir with your theme to KC themes dir, optionally update |
docker run -it -d -p8066:3306 -e MYSQL_ROOT_PASSWORD=0000 --name mysql57 -v ~/Documents/xxxx/mysqldata:/usr/local/mysql --platform linux/amd64 mysql Solved my problem |
If anyone wants to know the state of this issue or help, it now has moved to this discussion: keycloak/keycloak#8846 |
…les to Elasticsearch. Keycloak fixes for local Apple M1 development. See docker/for-mac#5310 (comment) for additional information
This works in 2022. I'm using 16.1.1, and updated the OP quote, and it solved my issue with JHipster 7.8.x that relies on keycloak for OAuth2 demos. |
FWIW This is still valid as of the date of this reply. I used it to run 14.0.0 with docker-compose and worked like a charm |
@michael-gates-techngs, did you try changing the |
@michael-gates-techngs these instructions do not work for version 17.0.0 and higher. If you want to build older version you can use a tag as @timothystone suggested. To build a newer version of Keycloak (17+) you have to modify script. New script (quarkus build): #/bin/zsh
# For versions 17 and above (quarkus)
VERSION=19.0.0 # set version here
cd /tmp
git clone git@github.com:keycloak/keycloak.git
cd keycloak/quarkus/container
git checkout $VERSION
docker build -t "quay.io/keycloak/keycloak:${VERSION}" . Source: keycloak/keycloak#8846 (comment) ; gist comment |
Thanks for the quick replies. I somehow missed the |
still working, tks! |
There hasn't been any activity on this issue for a long time. Mark the issue as fresh with a Prevent issues from auto-closing with a /lifecycle stale |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. /lifecycle locked |
I can't run Keycloak on browser using localhost , after running my docker container, here's my docker-compose.yml file
`
version: '3'
services:
Helium-Frontend-V1:
container_name: Helium-Frontend-V1
image: registry.gitlab.com/wecraft.tn/projects/helium/helium-frontend-v1:latest-snapshot
ports:
- "80:80"
links:
- api-organizations
- api-users
- api-registration
- helium-connect
- api-members
- api-messaging
networks:
- backend
api-organizations:
container_name: api-organizations
image: registry.gitlab.com/wecraft.tn/projects/helium/api-organizations:latest-snapshot
restart: always
ports:
- "8092:8092"
networks:
- backend
api-users:
container_name: api-users
image: registry.gitlab.com/wecraft.tn/projects/helium/api-users:latest-snapshot
restart: always
ports:
- "8093:8093"
networks:
- backend
api-messaging:
container_name: api-messaging
image: registry.gitlab.com/wecraft.tn/projects/helium/api-messaging:5fda3673
restart: always
ports:
- "8091:8090"
networks:
- backend
api-registration:
container_name: api-registration
image: registry.gitlab.com/wecraft.tn/projects/helium/api-registration:latest-snapshot
restart: always
ports:
- "8090:8090"
networks:
- backend
api-members:
container_name: api-members
image: registry.gitlab.com/wecraft.tn/projects/helium/api-members:latest-snapshot
restart: always
ports:
- "8094:8094"
networks:
- backend
helium-connect:
container_name: helium-connect
image: registry.gitlab.com/wecraft.tn/projects/helium/helium-connect:latest-snapshot
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
expose:
- 8080
command:
- "-b 0.0.0.0"
- "-Dkeycloak.import=/opt/jboss/keycloak/realm-exports/realm-export.json,/opt/jboss/keycloak/realm-exports/backapp-realm.json"
- "-Dkeycloak.profile.feature.account_api=enabled"
# - "/bin/sh -c 'cp ./standalone-ha.xml /opt/jboss/keycloak/standalone/configuration/standalone-ha.xml'"
ports:
- "8080:8080"
networks:
- backend
networks:
backend:
driver: "bridge"
`
and this the error I get everytime I try to run Keycloak on my container :
`
16:25:55,233 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("interface" => "private")]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.network.interface.private" => "WFLYSRV0082: failed to resolve interface private"}}
16:25:57,845 INFO [org.jboss.as.server] (ServerService Thread Pool -- 46) WFLYSRV0010: Deployed "keycloak-server.war" (runtime-name : "keycloak-server.war")
16:25:57,866 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service org.wildfly.network.interface.private: WFLYSRV0082: failed to resolve interface private
WFLYCTL0448: 46 additional services are down due to their dependencies being missing or failed
16:25:59,139 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
16:25:59,196 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: Keycloak 11.0.0 (WildFly Core 12.0.3.Final) started (with errors) in 88946ms - Started 481 of 943 services (53 services failed or missing dependencies, 700 services are lazy, passive or on-demand)
16:25:59,235 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
16:25:59,235 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
User with username 'admin' already added to '/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json'
`
The text was updated successfully, but these errors were encountered: