创建自己centos镜像
#编写自己的dockerfile文件
[root@sunrui ~]# vim mydockerfile-centos
FROM centos
MAINTAINER sunrui
ENV MYPATH /usr/local
WORKDIR $MYPATH
RUN yum -y install vim
RUN yum -y install net-tools
EXPOST 80
CMD echo $MYPATH
CMD echo "-----end-----"
CMD /bin/bash
#运行文件构建镜像
[root@sunrui ~]# docker build -f mydockerfile-centos -t mycentos:1.0 .
#测试运行
[root@sunrui ~]# docker run -it mycentos:1.0 /bin/bash
[root@53e421b6f2a5 local]# pwd
/usr/local