I have a wildfly container that is running from the custom WF Image using Dockerfile. Here I have added the custom standalone-full.xml file to the config folder(/opt/jboss/wildfly/standalone/configuration
) of wf and building the image accordingly.
And during docker run I am not mounting the config folder as we can't able to do reverse mounting(container to host) but I need that standalone-full-app.xml
file to be mounted to local.
So I tried soft link to create inside container and mount it to the respective directory, which is mounted to local during docker run command.
docker exec <wf_container> ln -s /opt/jboss/wildfly/standalone/configuration/standalone-full-app.xml /opt/jboss/wildfly/standalone/appconfig/
This directory is mounted to my local host -v /home/user/docker/app/config/:/opt/jboss/wildfly/standalone/appconfig/
I can able to read/write the soft link inside container (/opt/jboss/wildfly/standalone/appconfig/standalone-full-app.xml
) and it is reflecting in actual file.
but the same file I can't able to access in my local, it says no such file or directory found.
can someone please help me to achieve accessing my standalone-full-app.xml
file accessible in local?
FROM jboss/wildfly:14.0.1.Final
RUN rm /opt/jboss/wildfly/standalone/configuration/standalone.xml
RUN rm /opt/jboss/wildfly/standalone/configuration/standalone-ha.xml
RUN rm /opt/jboss/wildfly/standalone/configuration/standalone-full.xml
RUN rm /opt/jboss/wildfly/standalone/configuration/standalone-full-ha.xml
RUN rm -r /opt/jboss/wildfly/modules/system/layers/base/org/eclipse
ADD standalone.conf /opt/jboss/wildfly/bin/
ADD standalone-full-app.xml /opt/jboss/wildfly/standalone/configuration/
ADD modules /opt/jboss/wildfly/modules/
ADD startServer.sh /opt/jboss/wildfly/bin
RUN /opt/jboss/wildfly/bin/add-user.sh admin adminadmin --silent
RUN /opt/jboss/wildfly/bin/add-user.sh -a ejbuser ejbuser --silent
CMD /opt/jboss/wildfly/bin/startServer.sh -c standalone-full-app.xml -b 0.0.0.0 -bmanagement 0.0.0.0 -Djboss.management.http.port=9990 --debug
docker run --name ${WF_CONTAINER} -d -e TZ=${TIME_ZONE} \
-v /etc/localtime:/etc/localtime:ro \
-v /home/user/docker/app/config/:/opt/jboss/wildfly/standalone/appconfig/:rw \
-v /home/user/docker/app/deployments:/opt/jboss/wildfly/standalone/deployments/:rw \
-p 9990:9990 -p 8080:8080 -p 8787:8787 ${WF_IMAGE}