1.Dockerfile基础命令
FROM:基于基准镜像
LABEL&MAINTAINER:说明信息
MAINTAINER:forest.com
LABEL version = "1.0"
WORKDIR:设置工作目录
ADD©:复制文件
ENV:设置环境常量
2.Dockerfile运行指令
RUN&ENTRYPOINT&CMD:
eg:练习命令,手动构建redis镜像
FROM centos
RUN ["yum" , "install" , "-y" ,"gcc","gcc-c++","net-tools","make"]
WORKDIR /usr/local
ADD redis-4.0.14.tar.gz .
WORKDIR /usr/local/redis-4.0.14/src
RUN make && make install
WORKDIR /usr/local/redis-4.0.14
ADD redis-7000.conf .
EXPOSE 7000
CMD ["redis-server","redis-7000.conf"]