jck28-lucio-【实战】Docker 制作容器镜像实战

Docker 容器镜像制作命令

  • docker commit {容器名称} {镜像名称}
  • dockerfile

dockerfile指令详解

  • FROM (指定继承自哪个基础镜像)
  • RUN (运行shell命令)
  • ADD/COPY (复制文件)
  • USER (指定运行用户)
  • ENTRYPOINT (指定容器启动命令)
  • ENV (指定环境变量)

dockerfile

FROM centos:7

ADD entrypoint.sh /root

USER root

RUN yum install -y wget vim
RUN yum install -y vim wget
RUN yum install -y wget vim git
RUN yum install -y wget
RUN yum install -y openssh-server openssl
RUN yum install wget vim
RUN yum install git vim

USER jenkins
WORKDIR /root

ENTRYPOINT [“/bin/bash”, “/root/entrypoint.sh”]