搭建基于ubuntu的基础环境:
参考: http://open.daocloud.io/ru-he-kai-fa-yi-ge-php-mysql-de-docker-hua-ying-yong/
https://github.com/nicescale/docker-training/tree/master/first
Dockerfile:
1 #在ubuntu:trusty 基础上 安装 服务器必须环境信息 ,为后续 安装 php nginx 做准备 2 3 FROM ubuntu:14.04 4 5 MAINTAINER lxd 6 7 # 设置时间环境变量 8 ENV TZ "Asia/Shanghai" 9 10 #使用 阿里云 ubuntu 源 11 RUN cp /etc/apt/sources.list /etc/apt/sources.list_back 12 ADD sources.list /etc/apt/sources.list 13 14 # 刷新 源 15 RUN apt-get update 16 17 #安装 软件 18 RUN apt-get install -y curl wget tar bzip2 unzip vim passwd sudo hostname net-tools rsync man && \ 19 apt-get install -y gcc git make automake cmake patch logrotate && \ 20 apt-get install -y supervisor openssh-server && \ 21 apt-get clean && \ 22 apt-get autoclean 23 24 #写入 supervisord 配置信息 25 ADD supervisord.conf /etc/supervisord.conf 26 27 #创建必须的文件夹 28 RUN mkdir -p /etc/supervisor.conf.d && \ 29 mkdir -p /var/log/supervisor 30 31 #暴露 22 端口,sshd 32 EXPOSE 22 33 34 #执行动作 35 ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]