Reputation: 1008
I'm building a Docker web application and I need to assemble a Docker image with the following packages, in order:
So, in the docker image I first install Java, then Tomcat, then the JDBC driver for DB2, and finally my web app on top of it. I can get all of them from Maven, except the first one: the OpenJDK.
If it's not in Maven, do I need to include the whole OpenJDK 11 in my git repository, so it's there for the docker build?
Maybe, I'm doing this the wrong way, but I want to make sure the docker build works in any machine it runs. I'm thinking of CI/CD.
Upvotes: 1
Views: 3440
Reputation: 844
You can use the Docker image for OpenJDK 11
FROM openjdk:11
Or you can use Alpine base image if you need a smaller OpenJDK 11 image
FROM openjdk:11-alpine
In this way you'll already have the OpenJDK 11 in your container, without to use Maven to get it.
Upvotes: 1