完成Dockerfile的编写后,我们需要使用docker build命令来构建Docker镜像。 bash docker build -t openjdk17 . 这个命令会读取当前目录下的Dockerfile,并构建一个名为openjdk17的Docker镜像。 4. 运行并测试构建的镜像 最后,我们可以运行构建好的镜像来测试OpenJDK 17是否已正确安装。 bash docker run -it openjdk...
When creating a docker image to run a java program, it is desirable to us that the image is as small as possible. This is to speed up build and launch times mainly. This is especially important when caching is not able to help such as on ephemeral build instances or production execution...