Docker container launch : FileNotFoundException

Hi community, I am sort of new to docker. So having some issues trying to use it.

So I have a JVM application(scala) which during launch reads a jks(java keystore) file. File name is configured in a configuration file, and file itself is placed at project root. And all works fine.

Now I want to use this setup to run application using docker. So I have created the image. When I launch docker container, the file is not detected.

Exception in thread "main" java.io.FileNotFoundException: test.jks (No such file or directory)

So how do we solve this issue in a proper way in docker?

Hello,

usually error-messages contain at least a bit of truth :slight_smile: So the test.jks is not at the location expected by your code.

How do you put the test.jks into the container (is it already placed inside the image during build-process or MOUNTed during container-startup)? Have you double-checked that it is really available within the container with the correct permissions?

Where does your code want the test.jks to be? Absolute or relative path?
If absolute path - does it match the location the test.jks is available in the container?
If relative path - better use absolute path (at least within containers) because relative path depend on the location where your code is started and not necessarily where your code is located.