Lucas Earl
Lucas Earl

Reputation: 395

Dockerizing a maven app that uses oracle-ojdbc: How do you get the driver in there?

I'm an inexperienced docker user and I'm trying to dockerize my maven web application using Oracle. When I try to build using my maven image it fails saying: "Could not find artifact com.oracle:ojdbc14:jar:10.2.0.4.0 in central" which is expected since I have not included the driver anywhere.

My question is how can I make docker aware of the driver's location and thereby be able to build the app? Thanks

Upvotes: 4

Views: 808

Answers (1)

VonC
VonC

Reputation: 1327734

When I try to build using my maven image it fails saying: "Could not find artifact com.oracle:ojdbc14:jar:10.2.0.4.0 in central" which is expected since I have not included the driver anywhere.

You would need to reproduce in your Dockerfile the same setup (same M2_HOME, sans m2/repository settings) as the one which is working on your host (without docker)

You could start your Dockerfile from a maven image, or, as in this Dockerfile, from a jdk image, installing maven yourself, and deploying your missing jar the same way you would on your host.

Upvotes: 1

Related Questions