Just got a new Mac with the Apple M1 chip and am trying to set up my dev environment for a project I'm working on. I'm using Docker Desktop and added the platform flag to both the docker-compose.yml (platform: linux/x86_64
) and Dockerfile (FROM --platform=linux/amd64 openjdk:8-jdk-stretch
). I’m using OpenJDK 8 and sbt 0.13.15
The containers create fine and I can run sbt -Dsbt.ivy.home='.ivy2' -Dsbt.global.base='.sbt' -Dsbt.repository.config='.sbt/repositories'
from inside the docker shell and it will create a sbt
shell, but if I run compile
in this shell I get this error:
[info] Compiling 153 Scala sources and 2 Java sources to /opt/target/scala-2.10/classes...
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000400d9d7447, pid=9, tid=0x00000040b87ab700
#
# JRE version: OpenJDK Runtime Environment (8.0_242-b08) (build 1.8.0_242-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.242-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 12257 C2 scala.reflect.internal.Types$$anonfun$57.apply(Ljava/lang/Object;)Ljava/lang/Object; (12 bytes) @ 0x000000400d9d7447 [0x000000400d9d7080+0x3c7]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /opt/hs_err_pid9.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
Looking through the hs_err_pid9.log
that it created, the only out of the ordinary snippet is:
Event: 66.528 Thread 0x00000040a8020800 Exception <a 'java/io/FileNotFoundException'> (0x00000000f7eaf680) thrown at [/home/openjdk/jdk8u/hotspot/src/share/vm/prims/jni.cpp, line 710]
Event: 66.545 Thread 0x00000040a8020800 Exception <a 'java/io/FileNotFoundException'> (0x00000000f7eb0b38) thrown at [/home/openjdk/jdk8u/hotspot/src/share/vm/prims/jni.cpp, line 710]
Event: 67.214 Thread 0x00000040a801f800 Exception <a 'java/io/FileNotFoundException'> (0x00000000f7d343b8) thrown at [/home/openjdk/jdk8u/hotspot/src/share/vm/prims/jni.cpp, line 710]
Event: 67.219 Thread 0x00000040a801f800 Exception <a 'java/io/FileNotFoundException'> (0x00000000f7d35048) thrown at [/home/openjdk/jdk8u/hotspot/src/share/vm/prims/jni.cpp, line 710]
Event: 68.016 Thread 0x00000040a801f800 Implicit null exception at 0x000000400bd16a9b to 0x000000400bd16c51
Event: 69.405 Thread 0x00000040a801f800 Implicit null exception at 0x000000400c118986 to 0x000000400c118ea5
Event: 69.407 Thread 0x00000040a801f800 Implicit null exception at 0x000000400bdba136 to 0x000000400bdba4ed
Event: 69.556 Thread 0x00000040a801f800 Implicit null exception at 0x000000400bd29275 to 0x000000400bd2945d
Event: 69.567 Thread 0x00000040a801f800 Implicit null exception at 0x000000400be3adaf to 0x000000400be3ae19
Event: 69.835 Thread 0x00000040a801f800 Implicit null exception at 0x000000400be93a35 to 0x000000400be93de1
Here is the codebase for anybody that wants to take a look at the steps to set up the environment as well as the docker-compose.yml and Dockerfile which are both in the root directory.
RUN apt-get update
is even expected to have different results each time). While Nix can be used to build Docker images directly (seedockerTools
innixpkgs
), one can also write code that assembles native dependencies for whichever OS one prefers. – Exceptionalsbt
on an amd64-native JVM to suffice. – Exceptionallinux/amd64
for both? – Humblebee