标签:code 编写 touch tar bin list 一个 lin bsp
1. 下载jdk
jdk-8u251-linux-x64.tar.gz
2. 创建一个Dockerfile
touch Dockerfile
3. 编写Dockerfile
FROM centos:7 RUN cat /etc/redhat-release COPY jdk-8u251-linux-x64.tar.gz /opt/jdk/ RUN tar -zxf /opt/jdk/jdk-8u251-linux-x64.tar.gz -C /opt/jdk/ && rm -rf /opt/jdk/jdk-8u251-linux-x64.tar.gz ENV JAVA_HOME=/opt/jdk/jdk1.8.0_251/ ENV PATH=$PATH:$JAVA_HOME/bin RUN java -version
4. 构建镜像
docker build -t jdk8:1 .
5. 查看镜像
docker image list
标签:code 编写 touch tar bin list 一个 lin bsp
原文地址:https://www.cnblogs.com/zhangyy3/p/13156146.html