tdiesler / nessus-didcomm

Nessus DIDComm is about Digital Identity and Verifiable Credentials
Apache License 2.0
8 stars 1 forks source link

Docker image may run sluggish or not at all on Apple M2 #115

Closed tdiesler closed 1 year ago

tdiesler commented 1 year ago

On x86_64 the image runs a native java process like this ...

$ docker exec didcomm ps ax
PID   USER     TIME  COMMAND
    1 root      0:00 {didcomm.sh} /bin/sh ./bin/didcomm.sh run --headless script/travel-with-minor-bootstrap.txt
    8 root      2:22 java -Dlogback.configurationFile=config/logback-headless.xml -DserviceMatrixProperties=config/service-matrix.properties -jar nessus-didcomm-cli-23.4.0-SNAPSHOT.jar run --headless script/travel-with-minor-bootstrap.txt

on Apple M2 (i.e. arm64) it runs the same code in an emulator ...

$ docker exec didcomm ps ax
PID   USER     TIME  COMMAND
    1 root      0:00 {didcomm.sh} /usr/bin/qemu-x86_64 /bin/sh /bin/sh ./bin/didcomm.sh run --headless script/travel-with-minor-bootstrap.txt
    8 root      0:50 {java} /usr/bin/qemu-x86_64 /usr/lib/jvm/zulu18-ca/bin/java java -Dlogback.configurationFile=config/logback-headless.xml -DserviceMatrixProperties=config/service-matrix.properties -jar nessus-didcomm-cli-23.4.0-SNAPSHOT.jar run --headless script/travel-with-minor-bootstrap.txt

It seems that we need a multiarch image

tdiesler commented 1 year ago

As a workaround, I suggest to extract the distribution from the image or build from source. The CLI runs snappy on a native JRE. Building from source is not trivial (just yet), because there are dependencies on several other SNAPSHOT libraries that need to be built first.

tdiesler commented 1 year ago

Using multiple native nodes provide better support for more complicated cases that are not handled by QEMU and generally have better performance. You can add additional nodes to the builder instance using the --append flag.

tdiesler commented 1 year ago

Great. This now works as expected and I can now run the image instead of the local distro Done