[关闭]
@Dukebf 2017-08-27T15:44:38.000000Z 字数 1319 阅读 1040

常用Dockerfile

Docker


Apache && php

Dockerfile

  1. FROM ubuntu:14.04
  2. MAINTAINER Duke
  3. # 使用国内阿里源
  4. ADD sources.list /etc/apt/
  5. # 安装服务
  6. RUN apt-get -y update \
  7. && apt-get -y install php5 apache2 unzip supervisor
  8. # 切换工作目录
  9. WORKDIR /var/www/html/
  10. # 删除默认首页
  11. RUN rm /var/www/html/index.html
  12. VOLUME ["/var/www/html/"]
  13. COPY ./my_supervisor.conf /etc/supervisor/conf.d/my_supervisor.conf
  14. RUN /etc/init.d/apache2 start
  15. EXPOSE 80
  16. CMD ["/usr/bin/supervisord"]

后台进程运行
my_supervisor.conf

  1. [supervisord]
  2. nodaemon=true
  3. [program:apache2]
  4. command=service apache2 restart

阿里云镜像资源

  1. deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
  2. deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
  3. deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
  4. deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
  5. deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
  6. deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
  7. deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
  8. deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
  9. deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
  10. deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注