@Dukebf
2017-08-27T15:44:38.000000Z
字数 1319
阅读 1031
Docker
Dockerfile
FROM ubuntu:14.04
MAINTAINER Duke
# 使用国内阿里源
ADD sources.list /etc/apt/
# 安装服务
RUN apt-get -y update \
&& apt-get -y install php5 apache2 unzip supervisor
# 切换工作目录
WORKDIR /var/www/html/
# 删除默认首页
RUN rm /var/www/html/index.html
VOLUME ["/var/www/html/"]
COPY ./my_supervisor.conf /etc/supervisor/conf.d/my_supervisor.conf
RUN /etc/init.d/apache2 start
EXPOSE 80
CMD ["/usr/bin/supervisord"]
后台进程运行
my_supervisor.conf
[supervisord]
nodaemon=true
[program:apache2]
command=service apache2 restart
阿里云镜像资源
deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe