From 5773d270cac05022d01c8e8089d4b59fc5f60136 Mon Sep 17 00:00:00 2001 From: Shao Yu Lung Date: Mon, 19 Mar 2018 22:15:24 +0800 Subject: [PATCH] clean up aerospike and empty line --- php-fpm/Dockerfile-56 | 9 ++++++--- php-fpm/Dockerfile-70 | 7 +++++-- php-fpm/Dockerfile-71 | 9 ++------- php-fpm/Dockerfile-72 | 10 ++-------- workspace/Dockerfile-56 | 25 ++++++++----------------- workspace/Dockerfile-70 | 23 +++++++---------------- workspace/Dockerfile-71 | 19 +++---------------- workspace/Dockerfile-72 | 23 +++++------------------ 8 files changed, 38 insertions(+), 87 deletions(-) diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index 93bc0ba..4fd449a 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -206,14 +206,17 @@ RUN if [ ${INSTALL_EXIF} = true ]; then \ ##################################### # PHP Aerospike: ##################################### +USER root ARG INSTALL_AEROSPIKE=false ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} -# Copy aerospike configration for remote debugging -COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini + RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ + # Fix dependencies for PHPUnit within aerospike extension + apt-get update -yqq && \ + apt-get -y install sudo wget && \ # Install the php aerospike extension - curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php5/archive/3.4.15.tar.gz" \ + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php5/archive/master.tar.gz" \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ && ( \ diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index f0dfb44..b1d045e 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -213,12 +213,15 @@ RUN if [ ${INSTALL_EXIF} = true ]; then \ ##################################### # PHP Aerospike: ##################################### +USER root ARG INSTALL_AEROSPIKE=false ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} -# Copy aerospike configration for remote debugging -COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini + RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ + # Fix dependencies for PHPUnit within aerospike extension + apt-get update -yqq && \ + apt-get -y install sudo wget && \ # Install the php aerospike extension curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/master.tar.gz" \ && mkdir -p aerospike-client-php \ diff --git a/php-fpm/Dockerfile-71 b/php-fpm/Dockerfile-71 index 13c6001..78b7e53 100644 --- a/php-fpm/Dockerfile-71 +++ b/php-fpm/Dockerfile-71 @@ -213,13 +213,11 @@ RUN if [ ${INSTALL_EXIF} = true ]; then \ ##################################### # PHP Aerospike: ##################################### +USER root ARG INSTALL_AEROSPIKE=false ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} -# Copy aerospike configration for remote debugging -COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini - RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ # Fix dependencies for PHPUnit within aerospike extension apt-get update -yqq && \ @@ -235,10 +233,7 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ -;fi - -RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \ - rm /usr/local/etc/php/conf.d/aerospike.ini \ + && docker-php-ext-enable aerospike \ ;fi ##################################### diff --git a/php-fpm/Dockerfile-72 b/php-fpm/Dockerfile-72 index 0a372a2..073af76 100644 --- a/php-fpm/Dockerfile-72 +++ b/php-fpm/Dockerfile-72 @@ -216,18 +216,15 @@ RUN if [ ${INSTALL_EXIF} = true ]; then \ ##################################### # PHP Aerospike: ##################################### +USER root ARG INSTALL_AEROSPIKE=false ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} -# Copy aerospike configration for remote debugging -COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini - RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ # Fix dependencies for PHPUnit within aerospike extension apt-get update -yqq && \ apt-get -y install sudo wget && \ - # Install the php aerospike extension (using 7.2.0-in-progress branch until support for 7.2 on master) curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/7.2.0-in-progress.tar.gz" \ && mkdir -p aerospike-client-php \ @@ -239,10 +236,7 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ -;fi - -RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \ - rm /usr/local/etc/php/conf.d/aerospike.ini \ + && docker-php-ext-enable aerospike \ ;fi ##################################### diff --git a/workspace/Dockerfile-56 b/workspace/Dockerfile-56 index 52d2a00..9dc76b3 100644 --- a/workspace/Dockerfile-56 +++ b/workspace/Dockerfile-56 @@ -384,15 +384,15 @@ RUN if [ ${INSTALL_YARN} = true ]; then \ ##################################### USER root -ARG INSTALL_AEROSPIKE=true +ARG INSTALL_AEROSPIKE=false ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} -# Copy aerospike configration for remote debugging -COPY ./aerospike.ini /etc/php/5.6/cli/conf.d/aerospike.ini - RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ + # Fix dependencies for PHPUnit within aerospike extension + apt-get update -yqq && \ + apt-get -y install sudo wget && \ # Install the php aerospike extension - curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php5/archive/3.4.15.tar.gz" \ + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php5/archive/master.tar.gz" \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ && ( \ @@ -402,10 +402,9 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ -;fi - -RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \ - rm /etc/php/5.6/cli/conf.d/aerospike.ini \ + && echo 'extension=aerospike.so' >> /etc/php/5.6/cli/conf.d/aerospike.ini \ + && echo 'aerospike.udf.lua_system_path=/usr/local/aerospike/lua' >> /etc/php/5.6/cli/conf.d/aerospike.ini \ + && echo 'aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua' >> /etc/php/5.6/cli/conf.d/aerospike.ini \ ;fi ##################################### @@ -507,7 +506,6 @@ ARG INSTALL_LINUXBREW=true ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ - # Preparation apt-get upgrade -y && \ apt-get install -y build-essential make cmake scons curl git \ @@ -515,13 +513,10 @@ RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ gettext libtool flex bison \ libbz2-dev libcurl4-openssl-dev \ libexpat-dev libncurses-dev && \ - # Install the Linuxbrew git clone --depth=1 https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew && \ - echo "" >> ~/.bashrc && \ echo 'export PKG_CONFIG_PATH"=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ - # Setup linuxbrew echo 'export LINUXBREWHOME="$HOME/.linuxbrew"' >> ~/.bashrc && \ echo 'export PATH="$LINUXBREWHOME/bin:$PATH"' >> ~/.bashrc && \ @@ -577,19 +572,15 @@ USER root ARG INSTALL_SYMFONY=false ENV INSTALL_SYMFONY ${INSTALL_SYMFONY} RUN if [ ${INSTALL_SYMFONY} = true ]; then \ - mkdir -p /usr/local/bin \ && curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony \ && chmod a+x /usr/local/bin/symfony \ - # Symfony 3 alias && echo 'alias dev="php bin/console -e=dev"' >> ~/.bashrc \ && echo 'alias prod="php bin/console -e=prod"' >> ~/.bashrc \ - # Symfony 2 alias # && echo 'alias dev="php app/console -e=dev"' >> ~/.bashrc \ # && echo 'alias prod="php app/console -e=prod"' >> ~/.bashrc \ - ;fi ##################################### diff --git a/workspace/Dockerfile-70 b/workspace/Dockerfile-70 index 384dbbd..f9c5b0c 100644 --- a/workspace/Dockerfile-70 +++ b/workspace/Dockerfile-70 @@ -380,13 +380,13 @@ RUN if [ ${INSTALL_YARN} = true ]; then \ ##################################### USER root -ARG INSTALL_AEROSPIKE=true +ARG INSTALL_AEROSPIKE=false ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} -# Copy aerospike configration for remote debugging -COPY ./aerospike.ini /etc/php/7.0/cli/conf.d/aerospike.ini - RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ + # Fix dependencies for PHPUnit within aerospike extension + apt-get update -yqq && \ + apt-get -y install sudo wget && \ # Install the php aerospike extension curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/master.tar.gz" \ && mkdir -p aerospike-client-php \ @@ -398,10 +398,9 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ -;fi - -RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \ - rm /etc/php/7.0/cli/conf.d/aerospike.ini \ + && echo 'extension=aerospike.so' >> /etc/php/7.0/cli/conf.d/aerospike.ini \ + && echo 'aerospike.udf.lua_system_path=/usr/local/aerospike/lua' >> /etc/php/7.0/cli/conf.d/aerospike.ini \ + && echo 'aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua' >> /etc/php/7.0/cli/conf.d/aerospike.ini \ ;fi ##################################### @@ -503,7 +502,6 @@ ARG INSTALL_LINUXBREW=true ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ - # Preparation apt-get upgrade -y && \ apt-get install -y build-essential make cmake scons curl git \ @@ -511,13 +509,10 @@ RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ gettext libtool flex bison \ libbz2-dev libcurl4-openssl-dev \ libexpat-dev libncurses-dev && \ - # Install the Linuxbrew git clone --depth=1 https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew && \ - echo "" >> ~/.bashrc && \ echo 'export PKG_CONFIG_PATH"=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ - # Setup linuxbrew echo 'export LINUXBREWHOME="$HOME/.linuxbrew"' >> ~/.bashrc && \ echo 'export PATH="$LINUXBREWHOME/bin:$PATH"' >> ~/.bashrc && \ @@ -595,19 +590,15 @@ USER root ARG INSTALL_SYMFONY=false ENV INSTALL_SYMFONY ${INSTALL_SYMFONY} RUN if [ ${INSTALL_SYMFONY} = true ]; then \ - mkdir -p /usr/local/bin \ && curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony \ && chmod a+x /usr/local/bin/symfony \ - # Symfony 3 alias && echo 'alias dev="php bin/console -e=dev"' >> ~/.bashrc \ && echo 'alias prod="php bin/console -e=prod"' >> ~/.bashrc \ - # Symfony 2 alias # && echo 'alias dev="php app/console -e=dev"' >> ~/.bashrc \ # && echo 'alias prod="php app/console -e=prod"' >> ~/.bashrc \ - ;fi ##################################### diff --git a/workspace/Dockerfile-71 b/workspace/Dockerfile-71 index b5521c7..4ae3cfe 100644 --- a/workspace/Dockerfile-71 +++ b/workspace/Dockerfile-71 @@ -379,14 +379,10 @@ USER root ARG INSTALL_AEROSPIKE=false ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} -# Copy aerospike configration for remote debugging -COPY ./aerospike.ini /etc/php/7.1/cli/conf.d/aerospike.ini - RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ # Fix dependencies for PHPUnit within aerospike extension apt-get update -yqq && \ apt-get -y install sudo wget && \ - # Install the php aerospike extension curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/master.tar.gz" \ && mkdir -p aerospike-client-php \ @@ -398,10 +394,9 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ -;fi - -RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \ - rm /etc/php/7.1/cli/conf.d/aerospike.ini \ + && echo 'extension=aerospike.so' >> /etc/php/7.1/cli/conf.d/aerospike.ini \ + && echo 'aerospike.udf.lua_system_path=/usr/local/aerospike/lua' >> /etc/php/7.1/cli/conf.d/aerospike.ini \ + && echo 'aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua' >> /etc/php/7.1/cli/conf.d/aerospike.ini \ ;fi ##################################### @@ -512,7 +507,6 @@ ARG INSTALL_LINUXBREW=false ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ - # Preparation apt-get upgrade -y && \ apt-get install -y build-essential make cmake scons curl git \ @@ -520,13 +514,10 @@ RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ gettext libtool flex bison \ libbz2-dev libcurl4-openssl-dev \ libexpat-dev libncurses-dev && \ - # Install the Linuxbrew git clone --depth=1 https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew && \ - echo "" >> ~/.bashrc && \ echo 'export PKG_CONFIG_PATH"=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ - # Setup linuxbrew echo 'export LINUXBREWHOME="$HOME/.linuxbrew"' >> ~/.bashrc && \ echo 'export PATH="$LINUXBREWHOME/bin:$PATH"' >> ~/.bashrc && \ @@ -606,19 +597,15 @@ USER root ARG INSTALL_SYMFONY=false ENV INSTALL_SYMFONY ${INSTALL_SYMFONY} RUN if [ ${INSTALL_SYMFONY} = true ]; then \ - mkdir -p /usr/local/bin \ && curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony \ && chmod a+x /usr/local/bin/symfony \ - # Symfony 3 alias && echo 'alias dev="php bin/console -e=dev"' >> ~/.bashrc \ && echo 'alias prod="php bin/console -e=prod"' >> ~/.bashrc \ - # Symfony 2 alias # && echo 'alias dev="php app/console -e=dev"' >> ~/.bashrc \ # && echo 'alias prod="php app/console -e=prod"' >> ~/.bashrc \ - ;fi ##################################### diff --git a/workspace/Dockerfile-72 b/workspace/Dockerfile-72 index 3a042ee..7852a1b 100644 --- a/workspace/Dockerfile-72 +++ b/workspace/Dockerfile-72 @@ -379,16 +379,12 @@ USER root ARG INSTALL_AEROSPIKE=false ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} -# Copy aerospike configration for remote debugging -COPY ./aerospike.ini /etc/php/7.2/cli/conf.d/aerospike.ini - RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ # Fix dependencies for PHPUnit within aerospike extension apt-get update -yqq && \ apt-get -y install sudo wget && \ - - # Install the php aerospike extension - curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/master.tar.gz" \ + # Install the php aerospike extension (using 7.2.0-in-progress branch until support for 7.2 on master) + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/7.2.0-in-progress.tar.gz" \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ && ( \ @@ -398,10 +394,9 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ -;fi - -RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \ - rm /etc/php/7.2/cli/conf.d/aerospike.ini \ + && echo 'extension=aerospike.so' >> /etc/php/7.2/cli/conf.d/aerospike.ini \ + && echo 'aerospike.udf.lua_system_path=/usr/local/aerospike/lua' >> /etc/php/7.2/cli/conf.d/aerospike.ini \ + && echo 'aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua' >> /etc/php/7.2/cli/conf.d/aerospike.ini \ ;fi ##################################### @@ -507,7 +502,6 @@ ARG INSTALL_LINUXBREW=false ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ - # Preparation apt-get upgrade -y && \ apt-get install -y build-essential make cmake scons curl git \ @@ -515,13 +509,10 @@ RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ gettext libtool flex bison \ libbz2-dev libcurl4-openssl-dev \ libexpat-dev libncurses-dev && \ - # Install the Linuxbrew git clone --depth=1 https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew && \ - echo "" >> ~/.bashrc && \ echo 'export PKG_CONFIG_PATH"=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ - # Setup linuxbrew echo 'export LINUXBREWHOME="$HOME/.linuxbrew"' >> ~/.bashrc && \ echo 'export PATH="$LINUXBREWHOME/bin:$PATH"' >> ~/.bashrc && \ @@ -601,19 +592,15 @@ USER root ARG INSTALL_SYMFONY=false ENV INSTALL_SYMFONY ${INSTALL_SYMFONY} RUN if [ ${INSTALL_SYMFONY} = true ]; then \ - mkdir -p /usr/local/bin \ && curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony \ && chmod a+x /usr/local/bin/symfony \ - # Symfony 3 alias && echo 'alias dev="php bin/console -e=dev"' >> ~/.bashrc \ && echo 'alias prod="php bin/console -e=prod"' >> ~/.bashrc \ - # Symfony 2 alias # && echo 'alias dev="php app/console -e=dev"' >> ~/.bashrc \ # && echo 'alias prod="php app/console -e=prod"' >> ~/.bashrc \ - ;fi #####################################