java-1.8.0-openjdk
seems to have a large capacity because it contains icons etc.Dockerfile
FROM amazonlinux:2.0.20181114
RUN yum install -y java-1.8.0-openjdk-headless && yum clean all
#Create a Docker container image
$ docker build -t amazonlinux-jre8 .
(abridgement)
#(For confirmation) Enter the container with ssh and check the version
$ docker run -it amazonlinux-jre8 sh
sh-4.2# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
sh-4.2# javac -version
sh: javac: command not found
devel
Dockerfile
FROM amazonlinux:2.0.20181114
RUN yum install -y java-1.8.0-openjdk-devel && yum clean all
#Create a Docker container image
$ docker build -t amazonlinux-jdk
(abridgement)
#(For confirmation) Enter the container with ssh and check the version
$ docker run -it amazonlinux-jdk sh
sh-4.2# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
sh-4.2# javac -version
javac 1.8.0_191
docker images
command.$ docker images --format "table {{.Repository}}\t{{.Size}}" | grep amazonlinux
amazonlinux 162MB
amazonlinux-jre8 308MB
amazonlinux-jdk 362MB
java-1.8.0-openjdk-headless
java-1.8.0-openjdk-devel
Recommended Posts