Sign inSign up

ndigrazia/java

By ndigrazia

•Updated almost 2 years ago

Image
0

106

ndigrazia/java repository overview

⁠Write the Dockerfile: Here’s an example Dockerfile:

FROM debian:bullseye-slim

ENV JAVA_HOME=/usr/local/java/jdk1.8.0_431 ENV PATH="$JAVA_HOME/bin:$PATH"

COPY jdk-8u431-linux-x64.tar.gz /tmp/jdk.tar.gz

RUN mkdir -p /usr/local/java
&& tar -xzf /tmp/jdk.tar.gz -C /usr/local/java
&& rm /tmp/jdk.tar.gz

RUN java -version

WORKDIR /app

CMD ["bash"]

⁠Build the Docker Image:

Run the following command in the directory containing the Dockerfile and the jdk-8u321-linux-x64.tar.gz file:

docker build -t java:8u431 .

⁠Run the Container:

Start a container to verify the installation:

docker run -it ndigrazia/java:8u431 java -version

Tag summary

Content type

Image

Digest

sha256:81885e021…

Size

132.4 MB

Last updated

almost 2 years ago

docker pull ndigrazia/java:1.8.0_431