Not able to mount server log to host : java.io.FileNotFoundException: /opt/eap/standalone/log/server.log (Permission denied)

Posted on

When i am trying to mount server log to my host machine using belwo command getting (Permission denied error.

Docker run command:
docker run -v /opt/wildfly-logs/log:/opt/eap/standalone/log -p 9991:9990 -p 8082:8081 -d etransferusingredhatimage
Error in Server log :

10:17:38,755 ERROR [stderr] (Controller Boot Thread) at java.lang.Thread.run(Thread.java:748)
10:17:38,756 ERROR [stderr] (Controller Boot Thread) Caused by: java.io.FileNotFoundException: /opt/eap/standalone/log/server.log (Permission denied)
10:17:38,756 ERROR [stderr] (Controller Boot Thread) at java.io.FileOutputStream.open0(Native Method)
10:17:38,756 ERROR [stderr] (Controller Boot Thread) at java.io.FileOutputStream.open(FileOutputStream.java:270)


wildfly-logs]# ls -l
total 0
drwxr-xr-x. 2 jboss jboss 6 Feb 1 12:11 log
drwxr-xr-x. 2 wildflyloguser wildflyloguser 96 Feb 2 10:07 lognew