docker 安装在这里就不详细解说了
安装nginx
FROM centos
RUN rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
RUN yum -y install nginx
EXPOSE 80
ENTRYPOINT nginx && tailf /var/log/nginx/error.log
docker-compose.yml 进行 服务启动 挂载链接
nginx:
image: ‘web‘
ports:
- ‘9900:80‘
links:
- real_web:real_web
- real_web2:real_web2
volumes:
- /root/webuser:/opt:rw
restart: always
real_web:
image: ‘web‘
ports:
- ‘9901:80‘
restart: always
real_web2:
image: ‘web‘
ports:
- ‘9902:80‘
restart: always
本文出自 “linuxyy” 博客,请务必保留此出处http://linuxyy.blog.51cto.com/9490250/1839435
原文地址:http://linuxyy.blog.51cto.com/9490250/1839435