`
xieye
  • 浏览: 831087 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

使用docker建立php多版本共存的环境(2)

    博客分类:
  • PHP
阅读更多
总计有5个配置文件。

mysql的Dockerfile
FROM mysql:5.7

# set timezome
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone


COPY ./docker.cnf /etc/mysql/conf.d/docker.cnf
RUN chmod 644 /etc/mysql/conf.d/docker.cnf 

COPY ./mysql-file.cnf /etc/mysql/conf.d/mysql-file.cnf
RUN  chmod 644 /etc/mysql/conf.d/mysql-file.cnf


redis的
FROM redis:3.2

# set timezome
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone


nginx的
FROM nginx:1.12

# set timezome
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone


php5.6的
FROM devilbox/php-fpm:5.6-mods
MAINTAINER goozp "gzp@goozp.com"

# set timezome
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY ./sources.list /etc/apt/sources.list

RUN apt-get update \
 && apt-get upgrade -y \
 && apt-get install -y software-properties-common \
 && apt-get install -y git \
			vim \
			wget \
			zip \
			unzip \
			redis-server \
			mysql-client \
			memcached  
 

			
ENV COMPOSER_HOME /root/composer
WORKDIR	/usr/local/bin
RUN  curl -s http://getcomposer.org/installer | php \
 &&  chmod a+x composer.phar \
 &&  ln -s /usr/local/bin/composer.phar /bin/composer \
 &&  composer config -g repo.packagist composer https://packagist.laravel-china.org
 
ENV PATH $COMPOSER_HOME/vendor/bin:$PATH

WORKDIR /var/www


php7.2的
FROM devilbox/php-fpm:7.2-mods
MAINTAINER goozp "gzp@goozp.com"

# set timezome
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY ./sources.list /etc/apt/sources.list

RUN apt-get update \
 && apt-get upgrade -y \
 && apt-get install -y software-properties-common \
 && apt-get install -y git \
			vim \
			wget \
			zip \
			unzip \
			redis-server \
			mysql-client \
			memcached  
 

			
ENV COMPOSER_HOME /root/composer
WORKDIR	/usr/local/bin
RUN  curl -s http://getcomposer.org/installer | php \
 &&  chmod a+x composer.phar \
 &&  ln -s /usr/local/bin/composer.phar /bin/composer \
 &&  composer config -g repo.packagist composer https://packagist.laravel-china.org
 
ENV PATH $COMPOSER_HOME/vendor/bin:$PATH

WORKDIR /var/www

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics