Docker Community Forums

Share and learn in the Docker community.

Files inside the container can't be read by Jboss server

docker

(Hugo6) #1

Problem : when I am inside my container : I have to execute a script with a “get-childitem -Recurse” on a folder in order to use files inside this folder with a JBoss Application Server (otherwise there are unusable).

Files are correctly loaded (visible) to JBoss Application Server on Windows server 2016 but not on Win10.

I just got the problem when JBoss Application Server try to read files for the first time inside the container and not after (if I restart the server it works well).

In my Dockerfile : if I do a “get-childitem -Recurse” in a CMD instruction files are correctly loaded

Docker version : Version 17.09.0-ce-win33 (13620)
host OS : Windows 10 Enterprise
container OS : based on nanoserveur


(Sam) #2

and what is the problem info from when you do it in the running container?


(Hugo6) #3

Hi sdetweil !
Thanks for you reply.

Just to be sure you’ve correctly understood the problem : a part of the file system is not visible and that’s why the software does not have the desired behavior. There is no error message, just a problem in Jboss server due to the wrong file system loading.

I don’t want to keep this workaround and that’s why I’m trying to find the wrong behavior with file system loading in docker containers.

I hope it’s clearer.


(Sam) #4

ok… still not quite clear, but this sounds like a permissions problem. the host is Windows, and the container is linux

i suggest docker attach to the container BEFORE restarting the jboss server and examine the state of the files.


(Hugo6) #5

Hi @sdetweil I did a test with a minimalist JAVA program that list all modules files and print their names.
If I execute this program before launching the jboss server : it starts in only one time.

So what do you think ?

JAVA program : Files.walk(Paths.get("myPath")) .filter(p -> p.toString().endsWith(".xml")) .forEach(System.out::println);


(Sam) #6

interesting…

we have not discussed it… where are the files located, on a volume (docker run -v or --volume)
or are they copied in to the container as part of docker build?

just trying to understand the access problem


(Hugo6) #7

No volume : there are copied during the docker build


(Sam) #8

weird… never seen a problem where files copied in are not visible…

just for testing, if you run the little java app as part of the docker build, before attempting to start JBOSS does that resolve the problem?


(Hugo6) #9

yes, I don’t know if it’s a problem of visibility or accessibility. But I see files with the minimalist java program and as I said previously in the thread I can access to the them with the script “get-childitem -Recurse” but jboss don’t find the module file when it’s starting.

I just made a test and if I RUN the little program during the docker build in the Dockerfile : I can’t launch the jboss server the first time.


(Sam) #10

weird…

and i you made a script for docker run time
start jboss (it will fail)
run your java pgm
start jboss

i do not know why the files aren’t visible…

where in the container did u copy them to? a ‘volume’ of just some folder?


(Hugo6) #11

Files in the container are in a folder there is no volumes. Maybe it’s due to a too long file path ? But it’s weird after the program execution jboss starts normally