[root@promote /home/docker-lic-volume] # vim mydockerfile
FROM centos
MAINTAINER lic<935704787@qq.com>
ENV MYPATH /usr/local
WORKDIR $MYPATH
RUN yum -y install vim
RUN yum -y install net-tools
EXPOSE 80
CMD echo $MYPATH
CMD echo "----end----"
CMD /bin/bash
[root@promote /home/docker-lic-volume] # docker build -f /home/docker-lic-volume/mydockerfile -t mycentos:1.0 .
Sending build context to Docker daemon 2.048kB
Step 1/10 : FROM centos
---> 300e315adb2f
Step 2/10 : MAINTAINER lic<935704787@qq.com>
---> [Warning] IPv4 forwarding is disabled. Networking will not work.
---> Running in 9c9a4fd38b8d
Removing intermediate container 9c9a4fd38b8d
---> 2f7ee6776d3b
Step 3/10 : ENV MYPATH /usr/local
---> [Warning] IPv4 forwarding is disabled. Networking will not work.
---> Running in 154cf565aec9
Removing intermediate container 154cf565aec9
---> 5a3243d0aab5
Step 4/10 : WORKDIR $MYPATH