WFLYDS0012: IndexOutOfBoundsException while trying to run JBoss on Docker

I’m trying to run JBoss EAP 7.2 on Docker. Below is my Dockerfile:

FROM alpine

ARG DATABASE_CONFIGURATION=postgres.jbossoptions.orig
ARG PROXY_CONFIGURATION

ENV HTTP_PROXY=${PROXY_CONFIGURATION} 
 HTTPS_PROXY=${PROXY_CONFIGURATION} 
 http_proxy=${PROXY_CONFIGURATION} 
 https_proxy=${PROXY_CONFIGURATION}

RUN apk add --no-cache openjdk8-jre bash

RUN addgroup -S jboss && adduser -S jboss -G jboss

WORKDIR /opt/jboss

COPY jboss-eap-7.2*.zip jboss-eap-7.2.zip
ENV JBOSS_HOME /opt/jboss/jboss-eap-7.2
RUN mkdir $JBOSS_HOME
RUN unzip jboss-eap-7.2.zip 
    && rm jboss-eap-7.2.zip
COPY modules.zip .
RUN unzip -o modules.zip -d $JBOSS_HOME/modules/ 
    && rm modules.zip

#add user admin with password admin
RUN $JBOSS_HOME/bin/add-user.sh admin admin --silent

COPY assembly /setup-vm/assembly
COPY ${DATABASE_CONFIGURATION} /setup-vm/assembly/installjboss/jbossoptions.orig

RUN chown -R jboss:jboss /setup-vm/assembly 
    && chmod -R +x /setup-vm/assembly

WORKDIR /setup-vm/assembly/installjboss/

RUN find ../ -type f -print0 | xargs -0 dos2unix 
    && ./customize.sh jbossoptions.orig 
    && rm -rf $JBOSS_HOME/standalone/configuration/standalone_xml_history/current

RUN rm -rf $JBOSS_HOME/standalone/deployments/* 
    && cp -rf ../application.ear $JBOSS_HOME/standalone/deployments 
    && chown -R jboss:jboss $JBOSS_HOME

EXPOSE 8080 9990 9999 8787

USER jboss

CMD $JBOSS_HOME/bin/standalone.sh --server-config=standalone-full.xml --properties=jbossoptions.orig

I’m copying zip with JBoss to the image, copying the application and doing the customization of standalone-full.xml and running the server. Unfortunately, I’m getting the exception as below:

08:25:18,725 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0012: Scan of /opt/jboss/jboss-eap-7.2/standalone/deployments threw Exception: java.lang.IndexOutOfBoundsException
        at java.nio.Buffer.checkIndex(Buffer.java:546)
        at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:365)
        at org.jboss.as.server.deployment.scanner.ZipCompletionScanner.getUnsignedInt(ZipCompletionScanner.java:399)
        at org.jboss.as.server.deployment.scanner.ZipCompletionScanner.validateEndRecord(ZipCompletionScanner.java:169)
        at org.jboss.as.server.deployment.scanner.ZipCompletionScanner.isCompleteZip(ZipCompletionScanner.java:117)
        at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.isZipComplete(FileSystemDeploymentService.java:1095)
        at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.scanDirectory(FileSystemDeploymentService.java:935)
        at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.scan(FileSystemDeploymentService.java:598)
        at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService.scan(FileSystemDeploymentService.java:493)
        at org.jboss.as.server.deployment.scanner.FileSystemDeploymentService$DeploymentScanRunnable.run(FileSystemDeploymentService.java:255)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
        at org.jboss.threads.JBossThread.run(JBossThread.java:485)

I tried to run the server without ear with my application and this exception didn’t occur and JBoss was run. But when I try to run the server with my application on my local PC (no Docker), everything works fine. I tried many things: running as root, changing permissions to the folder, nothing helped. Does anyone have any clue?

Source: StackOverflow