Dockerfile构建镜像-基础
- Dockerfile
# this is a dockerfile FROM centos:7 MAINTAINER XD 123456@qq.com RUN echo "正在构建镜像!!!" WORKDIR /home/xdclass COPY 123.txt /home/xdclass RUN yum install -y net-tools
- docker build -t mycentos:v3 .
- docker images
- 进入验证
注意:命令COPY后面只能写相对路径,相对于dockerfile文件