j5ik2o / docker-controller-scala

MIT License
15 stars 5 forks source link

docker-controller-scala-zookeeper do not works on Apple Silicon #662

Closed zerosum closed 2 years ago

zerosum commented 2 years ago

Probrem

On an Apple Silicon machine, testcases which depend on docker-controller-scala-kafka hung-up in launching zookeeper containers.

And these sbt tasks as well:

Cause

zookeeper:3.4.9, the default image, is not compatible to arm64, so it doesn't work at all on Apple Silicon, like below:

❯ uname -m
arm64
❯ docker run -it zookeeper:3.4.9
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
ZooKeeper JMX enabled by default
Using config: /conf/zoo.cfg

// stop the world...

Images >= 3.5 are compatible to arm64, so we could see they say binding to port /0.0.0.0:2181.

❯ docker run -it zookeeper:3.5
ZooKeeper JMX enabled by default
Using config: /conf/zoo.cfg
2022-07-05 07:33:48,187 [myid:] - INFO  [main:QuorumPeerConfig@136] - Reading configuration from: /conf/zoo.cfg
2022-07-05 07:33:48,189 [myid:] - INFO  [main:QuorumPeerConfig@378] - clientPort is not set
2022-07-05 07:33:48,189 [myid:] - INFO  [main:QuorumPeerConfig@392] - secureClientPort is not set
2022-07-05 07:33:48,192 [myid:] - ERROR [main:QuorumPeerConfig@649] - Invalid configuration, only one server specified (ignoring)
2022-07-05 07:33:48,194 [myid:1] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2022-07-05 07:33:48,194 [myid:1] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2022-07-05 07:33:48,195 [myid:1] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2022-07-05 07:33:48,195 [myid:1] - WARN  [main:QuorumPeerMain@125] - Either no config or no quorum defined in config, running  in standalone mode
2022-07-05 07:33:48,198 [myid:1] - INFO  [main:ManagedUtil@45] - Log4j 1.2 jmx support found and enabled.
2022-07-05 07:33:48,209 [myid:1] - INFO  [main:QuorumPeerConfig@136] - Reading configuration from: /conf/zoo.cfg
2022-07-05 07:33:48,209 [myid:1] - INFO  [main:QuorumPeerConfig@378] - clientPort is not set
2022-07-05 07:33:48,210 [myid:1] - INFO  [main:QuorumPeerConfig@392] - secureClientPort is not set
2022-07-05 07:33:48,210 [myid:1] - ERROR [main:QuorumPeerConfig@649] - Invalid configuration, only one server specified (ignoring)
2022-07-05 07:33:48,210 [myid:1] - INFO  [main:ZooKeeperServerMain@118] - Starting server
2022-07-05 07:33:48,211 [myid:1] - INFO  [main:FileTxnSnapLog@115] - zookeeper.snapshot.trust.empty : false
2022-07-05 07:33:48,220 [myid:1] - INFO  [main:Environment@109] - Server environment:zookeeper.version=3.5.9-83df9301aa5c2a5d284a9940177808c01bc35cef, built on 01/06/2021 19:49 GMT
2022-07-05 07:33:48,221 [myid:1] - INFO  [main:Environment@109] - Server environment:host.name=977a9a06c0fb
2022-07-05 07:33:48,221 [myid:1] - INFO  [main:Environment@109] - Server environment:java.version=11.0.15
2022-07-05 07:33:48,221 [myid:1] - INFO  [main:Environment@109] - Server environment:java.vendor=Oracle Corporation
2022-07-05 07:33:48,221 [myid:1] - INFO  [main:Environment@109] - Server environment:java.home=/usr/local/openjdk-11
2022-07-05 07:33:48,221 [myid:1] - INFO  [main:Environment@109] - Server environment:java.class.path=/apache-zookeeper-3.5.9-bin/bin/../zookeeper-server/target/classes:/apache-zookeeper-3.5.9-bin/bin/../build/classes:/apache-zookeeper-3.5.9-bin/bin/../zookeeper-server/target/lib/*.jar:/apache-zookeeper-3.5.9-bin/bin/../build/lib/*.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/zookeeper-jute-3.5.9.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/zookeeper-3.5.9.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/slf4j-log4j12-1.7.25.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/slf4j-api-1.7.25.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-transport-native-unix-common-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-transport-native-epoll-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-transport-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-resolver-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-handler-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-common-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-codec-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-buffer-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/log4j-1.2.17.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/json-simple-1.1.1.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jline-2.14.6.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-util-ajax-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-util-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-servlet-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-server-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-security-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-io-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-http-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/javax.servlet-api-3.1.0.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jackson-databind-2.10.5.1.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jackson-core-2.10.5.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jackson-annotations-2.10.5.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/commons-cli-1.2.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/audience-annotations-0.5.0.jar:/apache-zookeeper-3.5.9-bin/bin/../zookeeper-*.jar:/apache-zookeeper-3.5.9-bin/bin/../zookeeper-server/src/main/resources/lib/*.jar:/conf:
2022-07-05 07:33:48,221 [myid:1] - INFO  [main:Environment@109] - Server environment:java.library.path=/usr/java/packages/lib:/lib:/usr/lib:/usr/lib64:/lib64
2022-07-05 07:33:48,221 [myid:1] - INFO  [main:Environment@109] - Server environment:java.io.tmpdir=/tmp
2022-07-05 07:33:48,221 [myid:1] - INFO  [main:Environment@109] - Server environment:java.compiler=<NA>
2022-07-05 07:33:48,221 [myid:1] - INFO  [main:Environment@109] - Server environment:os.name=Linux
2022-07-05 07:33:48,222 [myid:1] - INFO  [main:Environment@109] - Server environment:os.arch=aarch64
2022-07-05 07:33:48,222 [myid:1] - INFO  [main:Environment@109] - Server environment:os.version=5.10.104-linuxkit
2022-07-05 07:33:48,222 [myid:1] - INFO  [main:Environment@109] - Server environment:user.name=zookeeper
2022-07-05 07:33:48,222 [myid:1] - INFO  [main:Environment@109] - Server environment:user.home=/home/zookeeper
2022-07-05 07:33:48,222 [myid:1] - INFO  [main:Environment@109] - Server environment:user.dir=/apache-zookeeper-3.5.9-bin
2022-07-05 07:33:48,222 [myid:1] - INFO  [main:Environment@109] - Server environment:os.memory.free=240MB
2022-07-05 07:33:48,222 [myid:1] - INFO  [main:Environment@109] - Server environment:os.memory.max=1000MB
2022-07-05 07:33:48,224 [myid:1] - INFO  [main:Environment@109] - Server environment:os.memory.total=252MB
2022-07-05 07:33:48,226 [myid:1] - INFO  [main:ZooKeeperServer@953] - minSessionTimeout set to 4000
2022-07-05 07:33:48,227 [myid:1] - INFO  [main:ZooKeeperServer@962] - maxSessionTimeout set to 40000
2022-07-05 07:33:48,227 [myid:1] - INFO  [main:ZooKeeperServer@181] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 datadir /datalog/version-2 snapdir /data/version-2
2022-07-05 07:33:48,252 [myid:1] - INFO  [main:Log@169] - Logging initialized @432ms to org.eclipse.jetty.util.log.Slf4jLog
2022-07-05 07:33:48,309 [myid:1] - WARN  [main:ContextHandler@1660] - o.e.j.s.ServletContextHandler@323b36e0{/,null,STOPPED} contextPath ends with /*
2022-07-05 07:33:48,310 [myid:1] - WARN  [main:ContextHandler@1671] - Empty contextPath
2022-07-05 07:33:48,323 [myid:1] - INFO  [main:Server@375] - jetty-9.4.35.v20201120; built: 2020-11-20T21:17:03.964Z; git: bdc54f03a5e0a7e280fab27f55c3c75ee8da89fb; jvm 11.0.15+10
2022-07-05 07:33:48,345 [myid:1] - INFO  [main:DefaultSessionIdManager@334] - DefaultSessionIdManager workerName=node0
2022-07-05 07:33:48,345 [myid:1] - INFO  [main:DefaultSessionIdManager@339] - No SessionScavenger set, using defaults
2022-07-05 07:33:48,346 [myid:1] - INFO  [main:HouseKeeper@132] - node0 Scavenging every 600000ms
2022-07-05 07:33:48,349 [myid:1] - WARN  [main:ConstraintSecurityHandler@758] - ServletContext@o.e.j.s.ServletContextHandler@323b36e0{/,null,STARTING} has uncovered http methods for path: /*
2022-07-05 07:33:48,364 [myid:1] - INFO  [main:ContextHandler@916] - Started o.e.j.s.ServletContextHandler@323b36e0{/,null,AVAILABLE}
2022-07-05 07:33:48,376 [myid:1] - INFO  [main:AbstractConnector@331] - Started ServerConnector@22a637e7{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2022-07-05 07:33:48,376 [myid:1] - INFO  [main:Server@415] - Started @560ms
2022-07-05 07:33:48,377 [myid:1] - INFO  [main:JettyAdminServer@116] - Started AdminServer on address 0.0.0.0, port 8080 and command URL /commands
2022-07-05 07:33:48,379 [myid:1] - INFO  [main:ServerCnxnFactory@135] - Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
2022-07-05 07:33:48,380 [myid:1] - INFO  [main:NIOServerCnxnFactory@673] - Configuring NIO connection handler with 10s sessionless connection timeout, 1 selector thread(s), 8 worker threads, and 64 kB direct buffers.
+ 2022-07-05 07:33:48,381 [myid:1] - INFO  [main:NIOServerCnxnFactory@686] - binding to port /0.0.0.0:2181
2022-07-05 07:33:48,391 [myid:1] - INFO  [main:ZKDatabase@117] - zookeeper.snapshotSizeFactor = 0.33
2022-07-05 07:33:48,394 [myid:1] - INFO  [main:FileTxnSnapLog@404] - Snapshotting: 0x0 to /data/version-2/snapshot.0
2022-07-05 07:33:48,396 [myid:1] - INFO  [main:FileTxnSnapLog@404] - Snapshotting: 0x0 to /data/version-2/snapshot.0
2022-07-05 07:33:48,402 [myid:1] - INFO  [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@132] - PrepRequestProcessor (sid:0) started, reconfigEnabled=false
2022-07-05 07:33:48,405 [myid:1] - INFO  [main:ContainerManager@64] - Using checkIntervalMs=60000 maxPerMinute=10000

However, when we run a arm64-compat image with --env ZOO_SERVERS, they never say binding to port /0.0.0.0:2181. (similar issue: https://issues.apache.org/jira/browse/ZOOKEEPER-4238?focusedCommentId=17340212&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17340212)

❯ docker run -it -e ZOO_SERVERS=server.1=0.0.0.0:2888:3888 zookeeper:3.5
ZooKeeper JMX enabled by default
Using config: /conf/zoo.cfg
2022-07-05 07:37:00,553 [myid:] - INFO  [main:QuorumPeerConfig@136] - Reading configuration from: /conf/zoo.cfg
2022-07-05 07:37:00,561 [myid:] - INFO  [main:QuorumPeerConfig@378] - clientPort is not set
2022-07-05 07:37:00,561 [myid:] - INFO  [main:QuorumPeerConfig@392] - secureClientPort is not set
2022-07-05 07:37:00,564 [myid:] - ERROR [main:QuorumPeerConfig@649] - Invalid configuration, only one server specified (ignoring)
2022-07-05 07:37:00,565 [myid:1] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2022-07-05 07:37:00,565 [myid:1] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2022-07-05 07:37:00,565 [myid:1] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2022-07-05 07:37:00,565 [myid:1] - WARN  [main:QuorumPeerMain@125] - Either no config or no quorum defined in config, running  in standalone mode
2022-07-05 07:37:00,567 [myid:1] - INFO  [main:ManagedUtil@45] - Log4j 1.2 jmx support found and enabled.
2022-07-05 07:37:00,577 [myid:1] - INFO  [main:QuorumPeerConfig@136] - Reading configuration from: /conf/zoo.cfg
2022-07-05 07:37:00,577 [myid:1] - INFO  [main:QuorumPeerConfig@378] - clientPort is not set
2022-07-05 07:37:00,577 [myid:1] - INFO  [main:QuorumPeerConfig@392] - secureClientPort is not set
2022-07-05 07:37:00,577 [myid:1] - ERROR [main:QuorumPeerConfig@649] - Invalid configuration, only one server specified (ignoring)
2022-07-05 07:37:00,578 [myid:1] - INFO  [main:ZooKeeperServerMain@118] - Starting server
2022-07-05 07:37:00,582 [myid:1] - INFO  [main:FileTxnSnapLog@115] - zookeeper.snapshot.trust.empty : false
2022-07-05 07:37:00,601 [myid:1] - INFO  [main:Environment@109] - Server environment:zookeeper.version=3.5.9-83df9301aa5c2a5d284a9940177808c01bc35cef, built on 01/06/2021 19:49 GMT
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:host.name=07957b1eb586
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:java.version=11.0.15
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:java.vendor=Oracle Corporation
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:java.home=/usr/local/openjdk-11
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:java.class.path=/apache-zookeeper-3.5.9-bin/bin/../zookeeper-server/target/classes:/apache-zookeeper-3.5.9-bin/bin/../build/classes:/apache-zookeeper-3.5.9-bin/bin/../zookeeper-server/target/lib/*.jar:/apache-zookeeper-3.5.9-bin/bin/../build/lib/*.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/zookeeper-jute-3.5.9.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/zookeeper-3.5.9.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/slf4j-log4j12-1.7.25.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/slf4j-api-1.7.25.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-transport-native-unix-common-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-transport-native-epoll-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-transport-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-resolver-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-handler-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-common-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-codec-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/netty-buffer-4.1.50.Final.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/log4j-1.2.17.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/json-simple-1.1.1.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jline-2.14.6.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-util-ajax-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-util-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-servlet-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-server-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-security-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-io-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jetty-http-9.4.35.v20201120.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/javax.servlet-api-3.1.0.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jackson-databind-2.10.5.1.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jackson-core-2.10.5.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/jackson-annotations-2.10.5.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/commons-cli-1.2.jar:/apache-zookeeper-3.5.9-bin/bin/../lib/audience-annotations-0.5.0.jar:/apache-zookeeper-3.5.9-bin/bin/../zookeeper-*.jar:/apache-zookeeper-3.5.9-bin/bin/../zookeeper-server/src/main/resources/lib/*.jar:/conf:
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:java.library.path=/usr/java/packages/lib:/lib:/usr/lib:/usr/lib64:/lib64
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:java.io.tmpdir=/tmp
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:java.compiler=<NA>
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:os.name=Linux
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:os.arch=aarch64
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:os.version=5.10.104-linuxkit
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:user.name=zookeeper
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:user.home=/home/zookeeper
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:user.dir=/apache-zookeeper-3.5.9-bin
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:os.memory.free=240MB
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:os.memory.max=1000MB
2022-07-05 07:37:00,602 [myid:1] - INFO  [main:Environment@109] - Server environment:os.memory.total=252MB
2022-07-05 07:37:00,608 [myid:1] - INFO  [main:ZooKeeperServer@953] - minSessionTimeout set to 4000
2022-07-05 07:37:00,608 [myid:1] - INFO  [main:ZooKeeperServer@962] - maxSessionTimeout set to 40000
2022-07-05 07:37:00,609 [myid:1] - INFO  [main:ZooKeeperServer@181] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 datadir /datalog/version-2 snapdir /data/version-2
2022-07-05 07:37:00,630 [myid:1] - INFO  [main:Log@169] - Logging initialized @367ms to org.eclipse.jetty.util.log.Slf4jLog
2022-07-05 07:37:00,738 [myid:1] - WARN  [main:ContextHandler@1660] - o.e.j.s.ServletContextHandler@323b36e0{/,null,STOPPED} contextPath ends with /*
2022-07-05 07:37:00,738 [myid:1] - WARN  [main:ContextHandler@1671] - Empty contextPath
2022-07-05 07:37:00,756 [myid:1] - INFO  [main:Server@375] - jetty-9.4.35.v20201120; built: 2020-11-20T21:17:03.964Z; git: bdc54f03a5e0a7e280fab27f55c3c75ee8da89fb; jvm 11.0.15+10
2022-07-05 07:37:00,783 [myid:1] - INFO  [main:DefaultSessionIdManager@334] - DefaultSessionIdManager workerName=node0
2022-07-05 07:37:00,783 [myid:1] - INFO  [main:DefaultSessionIdManager@339] - No SessionScavenger set, using defaults
2022-07-05 07:37:00,791 [myid:1] - INFO  [main:HouseKeeper@132] - node0 Scavenging every 600000ms
2022-07-05 07:37:00,796 [myid:1] - WARN  [main:ConstraintSecurityHandler@758] - ServletContext@o.e.j.s.ServletContextHandler@323b36e0{/,null,STARTING} has uncovered http methods for path: /*
2022-07-05 07:37:00,804 [myid:1] - INFO  [main:ContextHandler@916] - Started o.e.j.s.ServletContextHandler@323b36e0{/,null,AVAILABLE}
2022-07-05 07:37:00,822 [myid:1] - INFO  [main:AbstractConnector@331] - Started ServerConnector@22a637e7{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2022-07-05 07:37:00,823 [myid:1] - INFO  [main:Server@415] - Started @562ms
2022-07-05 07:37:00,823 [myid:1] - INFO  [main:JettyAdminServer@116] - Started AdminServer on address 0.0.0.0, port 8080 and command URL /commands
2022-07-05 07:37:00,824 [myid:1] - INFO  [main:ContainerManager@64] - Using checkIntervalMs=60000 maxPerMinute=10000

Suggest of solution

upgrade base zookeeper image 3.4.9 -> 3.5 (or newer)

  object ZooKeeperController {
    final val DefaultImageName              = "zookeeper"
+   final val DefaultImageTag: Some[String] = Some("3.5")
-   final val DefaultImageTag: Some[String] = Some("3.4.9")
    final val DefaultZooPort                = 2181
+   final val RegexForWaitPredicate: Regex  = """binding to port /0.0.0.0:.*""".r
-   final val RegexForWaitPredicate: Regex  = """binding to port 0.0.0.0/0.0.0.0:.*""".r

makes ZOO_SERVERS optional

    private def environmentVariables(myId: Int) =
      Map(
        "ZOO_MY_ID"   -> myId.toString,
        "ZOO_PORT"    -> containerPort.toString,
-       "ZOO_SERVERS" -> s"server.$myId=0.0.0.0:2888:3888"
      ) ++ envVars

or depends on os.arch

    private def environmentVariables(myId: Int) = {
+      val defaultEnvVarsExcludeAarch64 = Option
+        .unless(sys.props("os.arch") == "aarch64") {
+          "ZOO_SERVERS" -> s"server.$myId=0.0.0.0:2888:3888"
+        }.toMap
+  
      Map(
        "ZOO_MY_ID" -> myId.toString,
        "ZOO_PORT"  -> containerPort.toString
+      ) ++ defaultEnvVarsExcludeAarch64 ++ envVars
-       "ZOO_SERVERS" -> s"server.$myId=0.0.0.0:2888:3888"
-      ) ++ envVars
    }

https://github.com/j5ik2o/docker-controller-scala/blob/main/docker-controller-scala-zookeeper/src/main/scala/com/github/j5ik2o/dockerController/zooKeeper/ZooKeeperController.scala

I'm not sure if the solution also works on x86_64.

j5ik2o commented 2 years ago

Thank you for your advice.

Changes were incorporated as follows https://github.com/j5ik2o/docker-controller-scala/pull/723