打造centos

官方

FROM scratch 99% Docker Hub中镜像都是从这个基础镜像来的,然后配置需要的软件与对应的配置

FROM centos
MAINTAINER 
ENV MYPATH /use/local
WORKDIR $MYPATH
RUN yum -y install vim 
RUN yum -y install net-tools
EXPOSE 81
CMD /bin/bash
☁  home  docker build -t donghao_centos:01 .
[+] Building 25.5s (8/8) FINISHED                                                    
 => [internal] load build definition from DockerFile                            0.0s
 => => transferring dockerfile: 210B                                            0.0s
 => [internal] load .dockerignore                                               0.0s
 => => transferring context: 2B                                                 0.0s
 => [internal] load metadata for docker.io/library/centos:latest                0.0s
 => CACHED [1/4] FROM docker.io/library/centos                                  0.0s
 => [2/4] WORKDIR /use/local                                                    0.0s
 => [3/4] RUN yum -y install vim                                               20.0s
 => [4/4] RUN yum -y install net-tools                                          4.1s
 => exporting to image                                                          1.1s 
 => => exporting layers                                                         1.1s 
 => => writing image sha256:830d545d51bf671a9687c48498aefb1ec49db21e5f7fa92348  0.0s 
 => => naming to docker.io/library/donghao_centos:01

查看步骤:

☁  home  docker history 830d545d51bf
IMAGE          CREATED         CREATED BY                                      SIZE      COMMENT
830d545d51bf   3 minutes ago   CMD ["/bin/sh" "-c" "/bin/bash"]                0B        buildkit.dockerfile.v0
      3 minutes ago   EXPOSE map[81/tcp:{}]                           0B        buildkit.dockerfile.v0
      3 minutes ago   RUN /bin/sh -c yum -y install net-tools # bu…   14.7MB    buildkit.dockerfile.v0
      3 minutes ago   RUN /bin/sh -c yum -y install vim # buildkit    64MB      buildkit.dockerfile.v0
      4 minutes ago   WORKDIR /use/local                              0B        buildkit.dockerfile.v0
      4 minutes ago   ENV MYPATH=/use/local                           0B        buildkit.dockerfile.v0
      4 minutes ago   MAINTAINER           0B        buildkit.dockerfile.v0
      2 months ago    /bin/sh -c #(nop)  CMD ["/bin/bash"]            0B        
      2 months ago    /bin/sh -c #(nop)  LABEL org.label-schema.sc…   0B        
      2 months ago    /bin/sh -c #(nop) ADD file:805cb5e15fb6e0bb0…   231MB

你可能感兴趣的:(centos,docker,bash,linux,raid)