Writing DockerFile


1. Make the dockerfile of the nginx server

# This is my first Dockfile
# version 1.0
# Author:fish
FROM centos
MAINTAINER   fish.chen
ADD   nginx-1.9.3.tar.gz /usr/local/src
ADD pcre-8.38.tar.gz  /usr/local/src
RUN yum -y install wget gcc gcc-c++ make openssl-devel bzip2
RUN useradd -s /sbin/nologin  -M www
WORKDIR /usr/local/src/nginx-1.9.3
RUN ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-pcre=/usr/local/src/pcre-8.38 && make && make install
RUN echo "daemon off;" >>/usr/local/nginx/conf/nginx.conf
# VOLUME
ENV PATH /usr/local/nginx/sbin:$PATH
EXPOSE 80
CMD ["ngxin"]



compile nginx

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
wget http://nginx.org/download/nginx-1.9.3.tar.gz
useradd -s /sbin/nologin  -M www
yum install wget gcc gcc-c++ make openssl-devel bzip2
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-pcre=/usr/local/src/pcre2-10.21
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-pcre=/usr/local/src/pcre-8.38
/usr/local/nginx/sbin/nginx
echo "daemon off;" >>/usr/local/nginx/conf/nginx.conf


2. Make the dockerfile of the stress server

# This is my first Dockfile
# version 1.0
# Author:fish
FROM centos
MAINTAINER   fish
ADD epel.repo /etc/yum.repos.d/
RUN yum install -y stress && yum clean all
ENTRYPOINT ["stress"]


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324775248&siteId=291194637