itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.39k stars 1.54k forks source link

Arm 64 Bits does not work (aarch64) #1876

Closed HiltonWS closed 1 year ago

HiltonWS commented 1 year ago

Describe the problem

Helo when using the Java17 version or the latest version the arm 64 bits version does not start.

Created with Kubernetes, repository https://github.com/HiltonWS/minecraft-server

Container definition

containers:
    - name: minecraft-server
      image: itzg/minecraft-server:java17
      ports:
        - name: minecraft
          hostPort: 25565
          containerPort: 25565
          protocol: TCP
      env:
        - name: EULA
          value: 'TRUE'
        - name: MOTD
          value: Hilton Network ATM8 1.0.7
        - name: TYPE
          value: FORGE
        - name: FORGE_VERSION
          value: 43.1.55
        - name: VERSION
          value: 1.19.2
        - name: MEMORY
          value: 5G
      resources:
        limits:
          cpu: '3'
          memory: 6G
        requests:
          cpu: '2'
          memory: 6G
      volumeMounts:
        - name: minecraft-data
          mountPath: /data
        - name: kube-api-access-xch4n
          readOnly: true
          mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      terminationMessagePath: /dev/termination-log
      terminationMessagePolicy: File
      imagePullPolicy: IfNotPresent
  restartPolicy: Always
  terminationGracePeriodSeconds: 30
  dnsPolicy: None
  serviceAccountName: default
  serviceAccount: default
  nodeName: worker03-rspi4
  hostNetwork: true
  securityContext: {}
  schedulerName: default-scheduler
  tolerations:
    - key: node.kubernetes.io/not-ready
      operator: Exists
      effect: NoExecute
      tolerationSeconds: 300
    - key: node.kubernetes.io/unreachable
      operator: Exists
      effect: NoExecute
      tolerationSeconds: 300
  priority: 0
  dnsConfig:
    nameservers:
      - 1.1.1.1
  enableServiceLinks: true
  preemptionPolicy: PreemptLowerPriority

Container logs

exec /start: exec format error
itzg commented 1 year ago

I can't recreate this issue, as shown in my testing here:

https://youtu.be/Tz8_OGvm09A

I suspect your docker/k8s installation is not configured to pull the correct platform from the multi-architecture manifest.

HiltonWS commented 1 year ago

@itzg Today with the lastest version I have this issue

[init] Changing gid of minecraft to 1000 groupmod: group 'minecraft' does not exist /start: line 52: /usr/sbin/gosu: Success

May some trash in my configuration?

HiltonWS commented 1 year ago

It´s running a FORGE instance.

Update

Using SKIP_SUDO = TRUE, its works.

itzg commented 1 year ago

I still am unable to recreate this issue using the following deployment on a Mac Apple silicon (aarch64):

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mc
  labels:
    app: mc
spec:
  replicas: 1
  template:
    metadata:
      name: mc
      labels:
        app: mc
    spec:
      containers:
        - name: mc
          image: itzg/minecraft-server:java17
          imagePullPolicy: IfNotPresent
          env:
            - name: EULA
              value: "true"
            - name: TYPE
              value: FORGE
            - name: FORGE_VERSION
              value: 43.1.55
            - name: VERSION
              value: 1.19.2
  selector:
    matchLabels:
      app: mc
HiltonWS commented 1 year ago

Clean up the cache and images, reinstall the Forge mod (All the Mods 8), using the latest version without sudo, facing now this error today

[init] Running as uid=0 gid=0 with /data as 'drwxrwxr-x 7 1000 1003 4096 Jan  8 00:18 /data'
[init] Resolved version given 1.19.2 into 1.19.2 and major version 1.19
Exception in thread "main" java.lang.ClassFormatError: Incompatible magic value 816775220 in class file org/xml/sax/InputSource

I'm using a raspberry pi 4 inside a Kubernetes cluster with micro8 with the latest Ubuntu LTS version.