From 31715355cfa9058c61c6537b64e5fd203753c44e Mon Sep 17 00:00:00 2001 From: dannc Date: Wed, 19 Jun 2019 14:24:13 +0700 Subject: [PATCH] Initial commit. Makefile and php 7.2, 7.3 dockerfiles. --- Makefile | 5 +++++ v7.2/Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ v7.3/Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 Makefile create mode 100644 v7.2/Dockerfile create mode 100644 v7.3/Dockerfile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..86cee68 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +build-72: + cd ./v7.2 && docker build --tag=local-composer:7.2 `pwd` + +build-73: + cd ./v7.3 && docker build --tag=local-composer:7.3 `pwd` diff --git a/v7.2/Dockerfile b/v7.2/Dockerfile new file mode 100644 index 0000000..1c6d343 --- /dev/null +++ b/v7.2/Dockerfile @@ -0,0 +1,36 @@ +FROM php:7.2-alpine + +RUN apk update && apk add --no-cache $PHPIZE_DEPS +RUN apk add --no-cache zlib-dev gd-dev libwebp-dev freetype-dev libpng-dev libjpeg-turbo-dev \ + curl +RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ \ + --with-jpeg-dir=/usr/include/ \ + --with-png-dir=/usr/include/ \ + --with-webp-dir=/usr/include/ \ + && docker-php-ext-install gd \ + && docker-php-ext-configure bcmath && docker-php-ext-install bcmath \ + && docker-php-ext-install zip \ + && pecl install xdebug && docker-php-ext-enable xdebug + +# Install composer +RUN curl -sS https://getcomposer.org/installer | php -- \ + --filename=composer \ + --install-dir=/usr/local/bin +RUN mkdir -m 777 -p /var/composer/ +ENV COMPOSER_HOME /var/composer/ + +# Install timecop +ENV PHP_TIMECOP_VERSION master +RUN curl -L -o /tmp/timecop.tar.gz https://github.com/hnw/php-timecop/archive/${PHP_TIMECOP_VERSION}.tar.gz \ + && mkdir -p timecop \ + && tar xfz /tmp/timecop.tar.gz -C timecop --strip-components=1 \ + && rm -r /tmp/timecop.tar.gz \ + && ( \ + cd timecop \ + && phpize \ + && ./configure \ + && make -j$(nproc) \ + && make install \ + ) \ + && rm -r timecop \ + && docker-php-ext-enable timecop diff --git a/v7.3/Dockerfile b/v7.3/Dockerfile new file mode 100644 index 0000000..e4b00c2 --- /dev/null +++ b/v7.3/Dockerfile @@ -0,0 +1,36 @@ +FROM php:7.3-alpine + +RUN apk update && apk add --no-cache $PHPIZE_DEPS +RUN apk add --no-cache zlib-dev gd-dev libwebp-dev freetype-dev libpng-dev libjpeg-turbo-dev \ + curl zip libzip-dev +RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ \ + --with-jpeg-dir=/usr/include/ \ + --with-png-dir=/usr/include/ \ + --with-webp-dir=/usr/include/ \ + && docker-php-ext-install gd \ + && docker-php-ext-configure bcmath && docker-php-ext-install bcmath \ + && docker-php-ext-configure zip --with-libzip && docker-php-ext-install zip \ + && pecl install xdebug && docker-php-ext-enable xdebug + +# Install composer +RUN curl -sS https://getcomposer.org/installer | php -- \ + --filename=composer \ + --install-dir=/usr/local/bin +RUN mkdir -m 777 -p /var/composer/ +ENV COMPOSER_HOME /var/composer/ + +# Install timecop +ENV PHP_TIMECOP_VERSION master +RUN curl -L -o /tmp/timecop.tar.gz https://github.com/hnw/php-timecop/archive/${PHP_TIMECOP_VERSION}.tar.gz \ + && mkdir -p timecop \ + && tar xfz /tmp/timecop.tar.gz -C timecop --strip-components=1 \ + && rm -r /tmp/timecop.tar.gz \ + && ( \ + cd timecop \ + && phpize \ + && ./configure \ + && make -j$(nproc) \ + && make install \ + ) \ + && rm -r timecop \ + && docker-php-ext-enable timecop