So apparently maven and tomcat have arm64 builds.
Adding --platform=linux/arm64/v8 to Dockerfile.dependencies like this

FROM --platform=linux/arm64/v8 maven:3-jdk-11 as build

I locally built this dependency image and used that as a base for the build 
in Dockerfile.test and Dockerfile.cli, like so

FROM --platform=linux/arm64/v8 anis/dspace-dep:latest as build

I also added the same line into the ant deploy and run tomcat section, like 
this

FROM --platform=linux/arm64/v8 tomcat:9-jdk11

So the build is working now!

I can look into if this multiarch support is easy to integrate to DSpace 
images and their deployments.
On Friday, January 21, 2022 at 4:09:16 PM UTC Anis wrote:

> Hi, and thanks for the quick reply!
>
> The versioning seems to be super confusing, but I think that Server VM 
> 18.9 is the server VM of java 11.
>
> Digging through some answers it seems that the base openjdk image is 
> incompatible with ARM-architechture, not 100% sure though, so I will keep 
> digging.
>
> - Anis
>
> On Friday, January 21, 2022 at 3:30:06 PM UTC Tim Donohue wrote:
>
>> Hi Anis,
>>
>> It appears, from that stacktrace, that you might somehow be using OpenJDK 
>> v18?  The DSpace 7 backend will only currently build on OpenJDK v11  
>> (though we will have v17 support coming soon in 7.2 via this PR 
>> https://github.com/DSpace/DSpace/pull/8104).
>>
>> I don't have a Mac to test things on, but this *might* be related to the 
>> Segfault?  Or it could be entirely unrelated, I don't know.  It's just what 
>> immediately jumped out at me.
>>
>> Tim
>>
>> On Friday, January 21, 2022 at 9:09:05 AM UTC-6 Anis wrote:
>>
>>> Hello!
>>>
>>> I've recently moved to a new laptop with the new M1 chip and tried to do 
>>> a docker build on the DSpace 7 images, but it fails to a segfault. I'm 
>>> wondering if anyone else has got the build working on these new chips? I'm 
>>> using Docker Desktop for Apple chips, I don't know if switching back to the 
>>> Intel one and emulating would be a working solution. 
>>>
>>> I ran the following command
>>> docker-compose -f docker-compose.yml -f docker-compose-cli.yml build
>>>
>>> and got the following stack trace
>>>
>>> #23 31.91 [INFO] --- maven-compiler-plugin:3.8.1:compile 
>>> (default-compile) @ dspace-services ---
>>> #23 35.02 [INFO] Changes detected - recompiling the module!
>>> #23 35.04 [INFO] Compiling 80 source files to 
>>> /app/dspace-services/target/classes
>>> #23 54.93 #
>>> #23 54.93 # A fatal error has been detected by the Java Runtime 
>>> Environment:
>>> #23 54.93 #
>>> #23 54.93 #  SIGSEGV (0xb) at pc=0x00000000e2ffba39, pid=11, tid=50
>>> #23 54.93 #
>>> #23 54.93 # JRE version: OpenJDK Runtime Environment 18.9 (11.0.13+8) 
>>> (build 11.0.13+8)
>>> #23 54.93 # Java VM: OpenJDK 64-Bit Server VM 18.9 (11.0.13+8, mixed 
>>> mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
>>> #23 54.93 # Problematic frame:
>>> #23 54.93 # C  0x00000000e2ffba39
>>> #23 54.93 #
>>> #23 54.93 # No core dump will be written. Core dumps have been disabled. 
>>> To enable core dumping, try "ulimit -c unlimited" before starting Java again
>>> #23 54.93 #
>>> #23 54.93 # An error report file with more information is saved as:
>>> #23 54.93 # /app/hs_err_pid11.log
>>> #23 54.94 Compiled method (c1)   54521 9406   !   2       
>>> com.sun.tools.javac.file.PathFileObject::getLastModified (18 bytes)
>>> #23 54.95  total in heap  [0x00000040161bdc10,0x00000040161be2d0] = 1728
>>> #23 54.95  relocation     [0x00000040161bdd88,0x00000040161bddf8] = 112
>>> #23 54.95  main code      [0x00000040161bde00,0x00000040161be060] = 608
>>> #23 54.95  stub code      [0x00000040161be060,0x00000040161be0e0] = 128
>>> #23 54.95  oops           [0x00000040161be0e0,0x00000040161be0f0] = 16
>>> #23 54.95  metadata       [0x00000040161be0f0,0x00000040161be110] = 32
>>> #23 54.95  scopes data    [0x00000040161be110,0x00000040161be170] = 96
>>> #23 54.95  scopes pcs     [0x00000040161be170,0x00000040161be210] = 160
>>> #23 54.95  dependencies   [0x00000040161be210,0x00000040161be218] = 8
>>> #23 54.95  handler table  [0x00000040161be218,0x00000040161be2c0] = 168
>>> #23 54.95  nul chk table  [0x00000040161be2c0,0x00000040161be2d0] = 16
>>> #23 54.95 Compiled method (c2)   54529 9444       4       
>>> com.sun.tools.javac.code.Types$12::visitClassType (10 bytes)
>>> #23 54.95  total in heap  [0x000000401c6aac10,0x000000401c6abce8] = 4312
>>> #23 54.95  relocation     [0x000000401c6aad88,0x000000401c6aae30] = 168
>>> #23 54.95  main code      [0x000000401c6aae40,0x000000401c6ab540] = 1792
>>> #23 54.95  stub code      [0x000000401c6ab540,0x000000401c6ab568] = 40
>>> #23 54.95  oops           [0x000000401c6ab568,0x000000401c6ab588] = 32
>>> #23 54.95  metadata       [0x000000401c6ab588,0x000000401c6ab608] = 128
>>> #23 54.95  scopes data    [0x000000401c6ab608,0x000000401c6ab8d0] = 712
>>> #23 54.95  scopes pcs     [0x000000401c6ab8d0,0x000000401c6abb60] = 656
>>> #23 54.95  dependencies   [0x000000401c6abb60,0x000000401c6abb70] = 16
>>> #23 54.95  handler table  [0x000000401c6abb70,0x000000401c6abc78] = 264
>>> #23 54.95  nul chk table  [0x000000401c6abc78,0x000000401c6abce8] = 112
>>> #23 54.99 #
>>> #23 54.99 # If you would like to submit a bug report, please visit:
>>> #23 54.99 #   https://bugreport.java.com/bugreport/crash.jsp
>>> #23 54.99 #
>>> #23 54.99 qemu: uncaught target signal 6 (Aborted) - core dumped
>>> #23 55.04 Aborted
>>> ------
>>> failed to solve: rpc error: code = Unknown desc = executor failed 
>>> running [/bin/sh -c mvn package -Pdspace-rest &&   mv 
>>> /app/dspace/target/${TARGET_DIR}/* /install &&   mvn clean]: exit code: 134
>>>
>>> thanks, 
>>>
>>> - Anis
>>>
>>

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/e13e4b8a-96e0-44f7-bf71-044510cdb206n%40googlegroups.com.

Reply via email to