添加 Ubuntu-lamp 基础镜像

This commit is contained in:
Medicean 2016-08-14 12:13:18 +08:00
parent 4d4bae9794
commit 5f429ac047
4 changed files with 69 additions and 0 deletions

38
base/lamp/Dockerfile Normal file
View File

@ -0,0 +1,38 @@
FROM ubuntu:14.04
MAINTAINER Medici.Yan <Medici.Yan@Gmail.com>
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Update sources
RUN apt-get update -y
# install http
RUN apt-get install -y apache2 vim bash-completion unzip
RUN mkdir -p /var/lock/apache2 /var/run/apache2
# install mysql
RUN apt-get install -y mysql-client mysql-server \
&& /etc/init.d/mysql start \
&& mysqladmin -u root password "root"
#RUN echo "NETWORKING=yes" > /etc/sysconfig/network
# start mysqld to create initial tables
#RUN service mysqld start
# install php
RUN apt-get install -y php5 php5-mysql php5-dev php5-gd php5-memcache php5-pspell php5-snmp snmp php5-xmlrpc libapache2-mod-php5 php5-cli
#RUN yum install -y php php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml
# install supervisord
# RUN apt-get install -y supervisor
# RUN mkdir -p /var/log/supervisor
COPY src/phpinfo.php /var/www/html/
COPY src/start.sh /start.sh
RUN chmod a+x /start.sh
EXPOSE 80 443
CMD ["/start.sh"]

25
base/lamp/README.md Normal file
View File

@ -0,0 +1,25 @@
## Ubuntu-lamp 环境
> 后续相关 PHP 环境基础镜像
### 信息
类型 | 用户名 | 密码
:-:|:-:|:-:
Mysql | root | root
### 获取环境:
1. 拉取镜像到本地
```
$ docker pull medicean/vulapps:base_lamp
```
2. 启动环境
```
$ docker run -d -p 8000:80 medicean/vulapps:base_lamp
```
> `-p 8000:80` 前面的 8000 代表物理机的端口,可随意指定。

View File

@ -0,0 +1,3 @@
<?php
phpinfo();
?>

3
base/lamp/src/start.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
/etc/init.d/mysql start
/usr/sbin/apachectl -DFOREGROUND