docker

V 2022-03-14T11:44:39.916339Z

Hey guys. I haven't worked much with containers, so this might be obvious to some of you. I've created my uberjar, created the image and run everything in docker-compose. However, my application relies on some resources in the uberjar. How do i use those? Right now i get this error: " Caused by: java.lang.IllegalArgumentException: Not a file: jar:file:/app/application-0.0.0-SNAPSHOT-standalone.jar!/json/data" even though this should be the location of these resources.

pavlosmelissinos 2022-03-14T12:00:26.962889Z

Can you successfully run the uberjar outside of docker? Seems like you need to add json/data to the classpath but if that were the case the uberjar wouldn't work at all.

V 2022-03-14T12:06:28.836799Z

Well i actually don't know. I have about 30 environment variables that need to be passed for the system to start up. I can run the main with those variables and it works fine, but i am unsure how i would parse those to the uberjar?

pavlosmelissinos 2022-03-14T12:14:32.396939Z

Well, the uberjar is created before you do anything with docker, so if the uberjar doesn't work this isn't a docker-related question. How are you building the uberjar? tools.build/depstar/something else?

V 2022-03-14T12:15:56.745949Z

leiningen

pavlosmelissinos 2022-03-14T12:20:19.189159Z

Passing environment variables to docker-compose is https://docs.docker.com/compose/environment-variables/ but no matter what you do it won't work if your uberjar is broken. I'm not familiar with leiningen but if I were you I'd focus my efforts there, with help from #leiningen

V 2022-03-14T12:23:05.466869Z

Alright, thanks a lot. I will try my luck there then 🙂

V 2022-03-14T11:45:07.223829Z

Maybe i am going about this the wrong way?