diff --git a/Dockerfile b/Dockerfile index 6502928..21ac8d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,9 @@ ENV LC_CTYPE=en_US.UTF-8 ENV LANG=en_US.UTF-8 ENV TERM xterm -# Add the "PHP 7" ppa +ARG PHP_VERSION=${PHP_VERSION:-70} + +# Add the PHP ppa RUN apt-get install -y software-properties-common && \ add-apt-repository -y ppa:ondrej/php @@ -29,7 +31,44 @@ RUN apt-get install -y software-properties-common && \ # Install "PHP Extentions", "libraries", "Software's" RUN apt-get update && \ - apt-get install -y --force-yes \ + apt-get install -y --allow-downgrades --allow-remove-essential \ + --allow-change-held-packages \ + pkg-config \ + libcurl4-openssl-dev \ + libedit-dev \ + libssl-dev \ + libxml2-dev \ + xz-utils \ + libsqlite3-dev \ + sqlite3 \ + git \ + curl \ + vim \ + nano \ + postgresql-client + +RUN if [ ${PHP_VERSION} = 56 ]; then \ + apt-get install -y --allow-downgrades --allow-remove-essential \ + --allow-change-held-packages \ + php5.6-cli \ + php5.6-common \ + php5.6-curl \ + php5.6-json \ + php5.6-xml \ + php5.6-mbstring \ + php5.6-mcrypt \ + php5.6-mysql \ + php5.6-pgsql \ + php5.6-sqlite \ + php5.6-sqlite3 \ + php5.6-zip \ + php5.6-bcmath \ + php5.6-memcached \ + php5.6-gd \ + php5.6-dev \ +;elif [ ${PHP_VERSION} = 70 ]; then \ + apt-get install -y --allow-downgrades --allow-remove-essential \ + --allow-change-held-packages \ php7.0-cli \ php7.0-common \ php7.0-curl \ @@ -46,20 +85,27 @@ RUN apt-get update && \ php7.0-memcached \ php7.0-gd \ php7.0-dev \ - pkg-config \ - libcurl4-openssl-dev \ - libedit-dev \ - libssl-dev \ - libxml2-dev \ - xz-utils \ - libsqlite3-dev \ - sqlite3 \ - git \ - curl \ - vim \ - nano \ - postgresql-client \ - && apt-get clean +;elif [ ${PHP_VERSION} = 71 ]; then \ + apt-get install -y --allow-downgrades --allow-remove-essential \ + --allow-change-held-packages \ + php7.1-cli \ + php7.1-common \ + php7.1-curl \ + php7.1-json \ + php7.1-xml \ + php7.1-mbstring \ + php7.1-mcrypt \ + php7.1-mysql \ + php7.1-pgsql \ + php7.1-sqlite \ + php7.1-sqlite3 \ + php7.1-zip \ + php7.1-memcached \ + php7.1-gd \ + php7.1-dev \ +;fi + +RUN apt-get clean ##################################### # Composer: diff --git a/Dockerfile-71 b/Dockerfile-71 deleted file mode 100644 index b0ab29d..0000000 --- a/Dockerfile-71 +++ /dev/null @@ -1,73 +0,0 @@ -# -#-------------------------------------------------------------------------- -# Image Setup -#-------------------------------------------------------------------------- -# - -FROM phusion/baseimage:latest - -MAINTAINER Mahmoud Zalt - -RUN DEBIAN_FRONTEND=noninteractive -RUN locale-gen en_US.UTF-8 - -ENV LANGUAGE=en_US.UTF-8 -ENV LC_ALL=en_US.UTF-8 -ENV LC_CTYPE=en_US.UTF-8 -ENV LANG=en_US.UTF-8 -ENV TERM xterm - -# Add the "PHP 7" ppa -RUN apt-get install -y software-properties-common && \ - add-apt-repository -y ppa:ondrej/php - -# -#-------------------------------------------------------------------------- -# Software's Installation -#-------------------------------------------------------------------------- -# - -# Install "PHP Extentions", "libraries", "Software's" -RUN apt-get update && \ - apt-get install -y --force-yes \ - php7.1-cli \ - php7.1-common \ - php7.1-curl \ - php7.1-json \ - php7.1-xml \ - php7.1-mbstring \ - php7.1-mcrypt \ - php7.1-mysql \ - php7.1-pgsql \ - php7.1-sqlite \ - php7.1-sqlite3 \ - php7.1-zip \ - php7.1-memcached \ - php7.1-gd \ - php7.1-dev \ - pkg-config \ - libcurl4-openssl-dev \ - libedit-dev \ - libssl-dev \ - libxml2-dev \ - xz-utils \ - libsqlite3-dev \ - sqlite3 \ - git \ - curl \ - vim \ - nano \ - postgresql-client \ - && apt-get clean - -##################################### -# Composer: -##################################### - -# Install composer and add its bin to the PATH. -RUN curl -s http://getcomposer.org/installer | php && \ - echo "export PATH=${PATH}:/var/www/vendor/bin" >> ~/.bashrc && \ - mv composer.phar /usr/local/bin/composer - -# Source the bash -RUN . ~/.bashrc