Search code examples
linuxdockerjbosswildfly

Wildfly on Docker: Deployment directory scan failed due to inaccessible deployment directory


I'm trying to deploy Wildfly 20 in Docker but I'm getting this error message and the EAR file is not deployed:

2021-09-01 12:06:03,368 WARN  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) 
WFLYDS0043: Deployment directory scan failed due to inaccessible deployment directory: 
/opt/jboss/wildfly/standalone/deployments

This is my Dockerfile:

FROM jboss/wildfly:20.0.1.Final
RUN /opt/jboss/wildfly/bin/add-user.sh admin admin ManagementRealm
ADD ./standalone.xml /opt/jboss/wildfly/standalone/configuration/

And I map the deployments directory to a Docker volume with Docker compose:

version: '3.7'
services:
  wildfly:
    image: image-wildfly:latest
    container_name: cont_wildfly
    networks:
      - net1
    command: /opt/jboss/wildfly/bin/standalone.sh -bmanagement 0.0.0.0 -b 0.0.0.0
    ports:
      - "8080:8080"
      - "9990:9990"
    volumes:
      - vol_wildfly:/opt/jboss/wildfly/standalone/deployments
networks:
   net1:
     name: net1
     
volumes:
  vol_wildfly:
     name: vol_wildfly

If I log into the container, I can see the EAR file in the deployments directory. I even created a doDeploy file manually, and nothing happens. What is the issue?

Note: if I upload the EAR file from the administrator console, it works, so the problem is with the volume.

UPDATE

This is the directory ownership when the volume is mounted, mapping to deployments directory in the container:

/ # ls -ld vol
drwxrwxr-x    2 1000     root          4096 Sep  5 11:22 vol

Solution

  • As of now, it seems that the permissions for the file and the volume didn't match or the volume had an unrelated error causing wildfly to fail while scanning for deployments.

    After running docker-compose down to clean any stale docker object that persisted between tests and changes the process ran as expected and maybe even successfully.

    If this accumulation of events is confirmed by @ps0604 I see this as sealed