常用Dockerfile

1、CentOS7

构建镜像
# cat Dockerfile 
FROM centos:7
MAINTAINER by madongsheng@kaixin-inc.com

RUN yum install -y wget && \
    cd /etc/yum.repos.d/ && rm -f *.repo && \
        wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo && \
        wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo && \
        yum install -y gcc gcc-c++ automake autoconf bash-completion python-pip telnet nmap sshpass tree

CMD ["/bin/bash"]

# docker build -t mycentos:v1 .

使用自己构建的镜像运行容器
# docker run -it -d --name=mg-yttx-cn-s2 mycentos:v1 /bin/bash

 

posted @ 2017-11-10 15:05  每天进步一点点!!!  阅读(301)  评论(0编辑  收藏  举报