This repository contains Dockerfiles for running and building Java applications on CentOS within docker containers.
Create a Dockerfile within the root of your java project, something like:
FROM infotecsoft/java:7
COPY . /usr/local/myapp
WORKDIR /usr/local/myapp
RUN javac App.java
CMD ["java", "App"]
You may then build and run the container as follows:
docker build -t myapp .
docker run --name app -d myapp
Create a Dockerfile within the root of your java application, something like:
FROM infotechsoft/java:7-jre
COPY . /usr/local/myapp
WORKDIR /usr/local/myapp
CMD ["java", "-cp ./lib/*:./config", "App"]
You may then build and run the container as follows:
docker build -t myapp .
docker run --name app -d myapp
Content type
Image
Digest
sha256:213aa186e…
Size
274 MB
Last updated
7 months ago
docker pull infotechsoft/java:zulu-21-jdk