vim Dockerfile
#First dockerfile FROM centos
MAINTAINER chen
RUN yum -y install wget
RUN wget -S https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN rpm -ivh epel-release-latest-7.noarch.rpm
RUN yum -y install nginx
EXPOSE 80
用dockerfile文件建立镜像
docker build -t web-nginx-1.7 .
FROM <image>
FROM <image><tag>
MAINTAINER 指定镜像的作者信息和联系信息
RUN 指定当前镜像运行命令包含两种指令模式(此指令是在容器构建时候运行的)
1、 RUN <command> (shell 模式)
/bin/sh -c command
RUN echo hello
2、RUN["executable","param1","param2"] (exec模式)
RUN["/bin/bash","-c","echo hello"]