From 5291f0f884b5484a7e9c94e2fd7c19795cbbbb89 Mon Sep 17 00:00:00 2001 From: Winfried Date: Mon, 1 May 2017 07:19:13 +0200 Subject: [PATCH] Merging workspace Dockerfiles Should fix #864 and #870 --- workspace/Dockerfile-71 | 168 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 165 insertions(+), 3 deletions(-) diff --git a/workspace/Dockerfile-71 b/workspace/Dockerfile-71 index a3199df6..b627085f 100644 --- a/workspace/Dockerfile-71 +++ b/workspace/Dockerfile-71 @@ -49,6 +49,22 @@ ARG PGID=1000 RUN groupadd -g $PGID laradock && \ useradd -u $PUID -g laradock -m laradock + +##################################### +# SOAP: +##################################### +USER root + +ARG INSTALL_SOAP=false +ENV INSTALL_SOAP ${INSTALL_SOAP} + +RUN if [ ${INSTALL_SOAP} = true ]; then \ + # Install the PHP SOAP extension + apt-get -y update && \ + add-apt-repository -y ppa:ondrej/php && \ + apt-get -y install libxml2-dev php7.1-soap \ +;fi + ##################################### # Set Timezone ##################################### @@ -81,7 +97,25 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \ ##################################### USER root -COPY ./crontab /var/spool/cron/crontabs +COPY ./crontab /etc/cron.d +RUN chmod -R 644 /etc/cron.d + +##################################### +# User Aliases +##################################### + +USER laradock +COPY ./aliases.sh /home/laradock/aliases.sh +RUN echo "" >> ~/.bashrc && \ + echo "# Load Custom Aliases" >> ~/.bashrc && \ + echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ + echo "" >> ~/.bashrc + +USER root +RUN echo "" >> ~/.bashrc && \ + echo "# Load Custom Aliases" >> ~/.bashrc && \ + echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ + echo "" >> ~/.bashrc ##################################### # xDebug: @@ -176,7 +210,7 @@ ENV INSTALL_NODE ${INSTALL_NODE} ENV NVM_DIR /home/laradock/.nvm RUN if [ ${INSTALL_NODE} = true ]; then \ # Install nvm (A Node Version Manager) - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.6/install.sh | bash && \ + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash && \ . $NVM_DIR/nvm.sh && \ nvm install ${NODE_VERSION} && \ nvm use ${NODE_VERSION} && \ @@ -209,10 +243,16 @@ USER laradock ARG INSTALL_YARN=false ENV INSTALL_YARN ${INSTALL_YARN} +ARG YARN_VERSION=latest +ENV YARN_VERSION ${YARN_VERSION} RUN if [ ${INSTALL_YARN} = true ]; then \ [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \ - curl -o- -L https://yarnpkg.com/install.sh | bash && \ + if [ ${YARN_VERSION} = "latest" ]; then \ + curl -o- -L https://yarnpkg.com/install.sh | bash; \ + else \ + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \ + fi && \ echo "" >> ~/.bashrc && \ echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \ ;fi @@ -255,6 +295,23 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ rm /etc/php/7.1/cli/conf.d/aerospike.ini \ ;fi +##################################### +# PHP V8JS: +##################################### +USER root + +ARG INSTALL_V8JS_EXTENSION=false +ENV INSTALL_V8JS_EXTENSION ${INSTALL_V8JS_EXTENSION} + +RUN if [ ${INSTALL_V8JS_EXTENSION} = true ]; then \ + # Install the php V8JS extension + add-apt-repository -y ppa:pinepain/libv8-5.4 \ + && apt-get update \ + && apt-get install -y php-dev php-pear libv8-5.4 \ + && pecl install v8js \ + && echo "extension=v8js.so" >> /etc/php/7.1/cli/php.ini \ +;fi + ##################################### # Non-root user : PHPUnit path ##################################### @@ -265,6 +322,111 @@ USER laradock RUN echo "" >> ~/.bashrc && \ echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc +##################################### +# Laravel Artisan Alias +##################################### +USER root + +RUN echo "" >> ~/.bashrc && \ + echo 'alias art="php artisan"' >> ~/.bashrc + +##################################### +# Laravel Envoy: +##################################### +USER laradock + +ARG INSTALL_LARAVEL_ENVOY=true +ENV INSTALL_LARAVEL_ENVOY ${INSTALL_LARAVEL_ENVOY} + +RUN if [ ${INSTALL_LARAVEL_ENVOY} = true ]; then \ + # Install the Laravel Envoy + composer global require "laravel/envoy=~1.0" \ +;fi + +##################################### +# Deployer: +##################################### +USER laradock + +ARG INSTALL_DEPLOYER=false +ENV INSTALL_DEPLOYER ${INSTALL_DEPLOYER} + +RUN if [ ${INSTALL_DEPLOYER} = true ]; then \ + # Install the Deployer + composer global require "deployer/deployer" \ +;fi + +##################################### +# Linuxbrew: +##################################### +USER root + +ARG INSTALL_LINUXBREW=true +ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} + +RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ + + # Preparation + apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y build-essential make cmake scons curl git \ + ruby autoconf automake autoconf-archive \ + gettext libtool flex bison \ + libbz2-dev libcurl4-openssl-dev \ + libexpat-dev libncurses-dev && \ + + # Install the Linuxbrew + git clone 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 && \ + echo 'export MANPATH="$LINUXBREWHOME/man:$MANPATH"' >> ~/.bashrc && \ + echo 'export PKG_CONFIG_PATH="$LINUXBREWHOME/lib64/pkgconfig:$LINUXBREWHOME/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ + echo 'export LD_LIBRARY_PATH="$LINUXBREWHOME/lib64:$LINUXBREWHOME/lib:$LD_LIBRARY_PATH"' >> ~/.bashrc \ +;fi + +##################################### +# Minio: +##################################### +USER root +ARG INSTALL_MC=false +ENV INSTALL_MC ${INSTALL_MC} + +COPY mc/config.json /root/.mc/config.json + +RUN if [ ${INSTALL_MC} = true ]; then\ + curl -fsSL -o /usr/local/bin/mc https://dl.minio.io/client/mc/release/linux-amd64/mc && \ + chmod +x /usr/local/bin/mc \ +;fi + +##################################### +# Symfony: +##################################### +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 + +USER laradock + # #-------------------------------------------------------------------------- # Final Touch