I want to add my custom JBOSS_HOME but when i run my dockerfile it give me an error.
JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
Unable to access jarfile
/home/shri/opt/jboss/wildfly/jboss-modules.jar
MY Dockerfile is:-
FROM jboss/wildfly
MAINTAINER shri
USER root
ENV JBOSS_HOME /home/shri/opt/jboss/wildfly
RUN mkdir -p $JBOSS_HOME
ADD jboss-modules.jar /home/shri/jboss/wildfly/
USER jboss
build dockerfile using:
docker build -t jboss .
Run dockerfile using:
docker run -p 8080:8080 jboss
It's not obvious what you are trying to achieve.
The WildFly in the parent image you are building from is located in the
/opt/jboss/wildfly, but you arejboss-modules.jarto/home/shri/jboss/wildfly/JBOSS_HOMEto/home/shri/opt/jboss/wildflywhich obviously doesn't exist.If you want just to use the custom
jboss-modules.jar, then the simplest is to overwrite the original one in/opt/jboss/wildfly/jboss-modules.jarand leave theJBOSS_HOMEunchanged.You can also have a look at Dockerfile for wildfly on git here: https://github.com/jboss-dockerfiles/wildfly/blob/master/Dockerfile