自定义镜像mycentos
1 先看看Hub默认的CentOS镜像是什么情况
2 编写我们的Dockerfile文件
from centos:latest
ENV mypath /usr
WORKDIR $mypath
RUN yum -y install vim
RUN yum -y install net-tools
EXPOSE 80
CMD /bin/bash
3 构建编写的dockerfile,生成新的镜像
docker build -f dockerfile文件 -t 新镜像名称:TAG .
docker build -f /myDocker/Dockerfile2 -t mycentos:1.3 .
4 运行mycentos镜像
docker run -it mycentos:1.3
5 列出镜像的变更历史
docker history 镜像名或者镜像ID
docker history mycentos:1.3