FROM centos:7
RUN cd /etc/yum.repos.d && mkdir bak && mv *.repo bak/ \
    && curl -s -o ./Centos-7.repo https://mirrors.aliyun.com/repo/Centos-7.repo \
    && curl -s -o ./epel.repo https://mirrors.aliyun.com/repo/epel-7.repo \
    && sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' Centos-7.repo \
    && yum clean all && yum makecache fast \
    && yum install -y wget vim openssh-server net-tools initscripts \
    && /usr/bin/ssh-keygen -A &&  mkdir /var/run/sshd && echo 'UseDNS no' >>  /etc/ssh/sshd_config && sed -i -e '/pam_loginuid.so/d' /etc/pam.d/sshd \
    && yum clean all && rm -rf /var/tmp/* \
    && echo 'root:123.com' |chpasswd
RUN yum install -y gcc gcc-c++ make \
    openssl-devel pcre-devel gd-devel \
    iproute net-tools telnet wget curl && \
    yum clean all && \
    rm -rf /var/cache/yum/*
RUN wget http://nginx.org/download/nginx-1.15.5.tar.gz && \
    tar zxf nginx-1.15.5.tar.gz && \
    cd nginx-1.15.5 && \
    ./configure --prefix=/usr/local/nginx \
    --with-http_ssl_module \
    --with-http_stub_status_module && \
    make -j 4 && make install && \
    rm -rf /usr/local/nginx/html/* && \
    echo "ok" >> /usr/local/nginx/html/status.html && \
    cd / && rm -rf nginx-1.12.2* && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ENV PATH $PATH:/usr/local/nginx/sbin
WORKDIR /usr/local/nginx
EXPOSE 22 80
CMD /usr/local/nginx/sbin/nginx;/usr/sbin/sshd -D

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐