在 Docker 容器 (OS-Mac M1) 中安装 Keycloack 时出现错误

MAY*_*KUR 10 java docker

我在 M1 Mac 上的 Docker 容器中安装 Keycloack 时遇到问题

我使用此代码来安装 Keycloack

docker run -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -p 8080:8080 jboss/keycloak
Run Code Online (Sandbox Code Playgroud)

我将这段代码粘贴到我的终端中。粘贴此代码后,我收到这些问题或错误。

08:32:06,727 ERROR [org.jboss.modcluster] (ServerService Thread Pool -- 58) MODCLUSTER000034: Failed to start advertise listener: java.net.SocketException: Protocol not available (Error setting socket option)
Run Code Online (Sandbox Code Playgroud)
    08:32:12,771 ERROR [org.jgroups.protocols.UDP] (ServerService Thread Pool -- 58) failed setting interface to /172.17.0.2: java.net.SocketException: Protocol not available (Error setting socket option)

08:32:12,775 ERROR [org.jgroups.protocols.UDP] (ServerService Thread Pool -- 58) failed setting interface to /172.17.0.2: java.net.SocketException: Protocol not available (Error setting socket option)

08:32:12,780 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 58) MSC000001: Failed to start service org.wildfly.clustering.jgroups.channel.ee: org.jboss.msc.service.StartException in service org.wildfly.clustering.jgroups.channel.ee: java.lang.IllegalStateException: java.net.SocketException: Protocol not available
Run Code Online (Sandbox Code Playgroud)
    08:32:13,179 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([

    ("subsystem" => "jgroups"),

    ("channel" => "ee")

]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.clustering.jgroups.channel.ee" => "java.lang.IllegalStateException: java.net.SocketException: Protocol not available

    Caused by: java.lang.IllegalStateException: java.net.SocketException: Protocol not available

    Caused by: java.net.SocketException: Protocol not available"}}

08:32:13,225 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 46) WFLYSRV0010: Deployed "keycloak-server.war" (runtime-name : "keycloak-server.war")

08:32:13,233 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report

WFLYCTL0186:   Services which failed to start:      service org.wildfly.clustering.jgroups.channel.ee: java.lang.IllegalStateException: java.net.SocketException: Protocol not available

WFLYCTL0448: 42 additional services are down due to their dependencies being missing or failed

08:32:13,491 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server

08:32:13,506 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: Keycloak 15.0.2 (WildFly Core 15.0.1.Final) started (with errors) in 24942ms - Started 497 of 930 services (48 services failed or missing dependencies, 683 services are lazy, passive or on-demand)

08:32:13,514 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management

08:32:13,514 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
Run Code Online (Sandbox Code Playgroud)

Kel*_*ago 13

脚步:

克隆 Keycloak 容器存储库:

git clone git@github.com:keycloak/keycloak-containers.git
Run Code Online (Sandbox Code Playgroud)

打开服务器目录(cd keycloak-containers/server)签出所需版本,例如。git checkout 13.0.1 构建 docker

image docker build -t jboss/keycloak:13.0.1 .
Run Code Online (Sandbox Code Playgroud)

运行钥匙斗篷

docker run --rm -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin jboss/keycloak:13.0.1
Run Code Online (Sandbox Code Playgroud)

您还可以使用此脚本:

#/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}" .
Run Code Online (Sandbox Code Playgroud)

检查此报告链接上的解决方案: Github问题