From 0287bf360c891dae6b9295fd9c0f68fd7111d3da Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Wed, 11 Mar 2020 15:47:54 -0700 Subject: [PATCH 01/14] cleaned up repo --- 7.2/alpine3.11/fpm/Dockerfile | 20 ++++++--------- 7.2/alpine3.11/fpm/publish-image.sh | 8 +++++- 7.2/stretch/apache/Dockerfile | 25 +++++++++---------- 7.2/stretch/apache/publish-image.sh | 18 +++++++------ 7.4/buster/apache/Dockerfile | 21 ++++++---------- 7.4/buster/apache/publish-image.sh | 21 +++++++++------- polyscripting/CONTRIBUTING.md | 4 +++ polyscripting/Dockerfile | 1 + polyscripting/LICENSE | 7 ++++++ polyscripting/build.sh | 1 + .../lambda/build-scrambled-lambda.sh | 1 + polyscripting/run.sh | 1 + polyscripting/scripts/build-scrambled.sh | 1 + polyscripting/scripts/polyscript-enable | 1 + .../src/scrambler/dictionaryHandler.go | 2 ++ .../src/scrambler/randomizeString.go | 2 ++ polyscripting/src/scrambler/scrambler.go | 2 ++ .../src/tokenizer/snip-transform.php | 1 + .../src/tokenizer/tok-php-transformer.php | 3 +++ polyscripting/tools/alpine/publish-image.sh | 1 + polyscripting/tools/apache/publish-image.sh | 1 + polyscripting/tools/dockerfile-builder.sh | 3 ++- polyscripting/tools/publish-all.sh | 1 + polyscripting/tools/publish-image.sh | 5 ++-- 24 files changed, 91 insertions(+), 60 deletions(-) create mode 100644 polyscripting/CONTRIBUTING.md create mode 100644 polyscripting/LICENSE diff --git a/7.2/alpine3.11/fpm/Dockerfile b/7.2/alpine3.11/fpm/Dockerfile index 7174e301dd..e880c97c19 100644 --- a/7.2/alpine3.11/fpm/Dockerfile +++ b/7.2/alpine3.11/fpm/Dockerfile @@ -1,5 +1,4 @@ -FROM polyverse/php-polyscripting-builder:latest as builder - +FROM polyverse/php-polyscripting-builder:dcc0be30bb5a42de88c5c17e0a3ef90e69209575 as builder # # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" # @@ -10,7 +9,7 @@ FROM alpine:3.11 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS \ +ENV PHPIZE_DEPS bison \ autoconf \ dpkg-dev dpkg \ file \ @@ -23,15 +22,10 @@ ENV PHPIZE_DEPS \ # persistent / runtime deps RUN apk add --no-cache \ - $PHPIZE_DEPS \ ca-certificates \ curl \ tar \ - vim \ - bison \ xz \ - libxml2-dev \ - bash \ # https://github.com/docker-library/php/issues/494 openssl @@ -70,9 +64,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" ENV GPG_KEYS 1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F -ENV PHP_VERSION 7.2.27 -ENV PHP_URL="https://www.php.net/get/php-7.2.27.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.27.tar.xz.asc/from/this/mirror" -ENV PHP_SHA256="7bd0fb9e3b63cfe53176d1f3565cd686f90b3926217158de5ba57091f49e4c32" PHP_MD5="" +ENV PHP_VERSION 7.2.28 +ENV PHP_URL="https://www.php.net/get/php-7.2.28.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.28.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="afe1863301da572dee2e0bad8014813bcced162f980ddc8ec8e41fd72263eb2d" PHP_MD5="" RUN set -eux; \ \ @@ -167,7 +161,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - ${POLYSCRIPT_PATH}/polyscript-enable; \ + ${POLYSCRIPT_PATH}/polyscript-enable \ find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -242,4 +236,4 @@ STOPSIGNAL SIGQUIT EXPOSE 9000 CMD ["php-fpm"] -#### \ No newline at end of file +#### diff --git a/7.2/alpine3.11/fpm/publish-image.sh b/7.2/alpine3.11/fpm/publish-image.sh index 24020b1164..68fd606fa4 100755 --- a/7.2/alpine3.11/fpm/publish-image.sh +++ b/7.2/alpine3.11/fpm/publish-image.sh @@ -1,6 +1,12 @@ #!/bin/bash +# Copyright (c) 2020 Polyverse Corporation -image="polyverse/ps-php7.2-fpm" +type="$(basename $PWD)" +build="$(basename $(dirname $PWD))" +php_ver="$(basename $(dirname $(dirname $PWD)))" +image="polyverse/ps-php${php_ver}-${build}-${type}" + +echo "Image $image being built" echo "$(date) Obtaining current git sha for tagging the docker image" headsha=$(git rev-parse --verify HEAD) diff --git a/7.2/stretch/apache/Dockerfile b/7.2/stretch/apache/Dockerfile index 031a4c63c2..87aeb0869e 100644 --- a/7.2/stretch/apache/Dockerfile +++ b/7.2/stretch/apache/Dockerfile @@ -1,4 +1,9 @@ -FROM polyverse/php-polyscripting-builder:latest as builder +FROM polyverse/php-polyscripting-builder:dcc0be30bb5a42de88c5c17e0a3ef90e69209575 as builder +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# FROM debian:stretch-slim @@ -13,14 +18,13 @@ RUN set -eux; \ # dependencies required for running "phpize" # (see persistent deps below) -ENV PHPIZE_DEPS \ +ENV PHPIZE_DEPS bison \ autoconf \ dpkg-dev \ file \ g++ \ gcc \ libc-dev \ - vim \ make \ pkg-config \ re2c @@ -32,8 +36,6 @@ RUN set -eux; \ $PHPIZE_DEPS \ ca-certificates \ curl \ - bison \ - libxml2-dev \ xz-utils \ ; \ rm -rf /var/lib/apt/lists/* @@ -107,7 +109,7 @@ RUN { \ && a2enconf docker-php ENV PHP_EXTRA_BUILD_DEPS apache2-dev -ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi PHP_EXTRA_VERSION="-polyscripted" +ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi #### # Apply stack smash protection to functions using local buffers and alloca() @@ -123,7 +125,7 @@ ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" ENV GPG_KEYS 1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F -ENV PHP_VERSION 7.2.28-polyscripted +ENV PHP_VERSION 7.2.28 ENV PHP_URL="https://www.php.net/get/php-7.2.28.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.28.tar.xz.asc/from/this/mirror" ENV PHP_SHA256="afe1863301da572dee2e0bad8014813bcced162f980ddc8ec8e41fd72263eb2d" PHP_MD5="" @@ -169,8 +171,6 @@ ENV PHP_SRC_PATH "/usr/src/php" WORKDIR $POLYSCRIPT_PATH COPY --from=builder /polyscripting/ ./ - - RUN set -eux; \ \ savedAptMark="$(apt-mark showmanual)"; \ @@ -242,7 +242,6 @@ RUN set -eux; \ --with-libedit \ --with-openssl \ --with-zlib \ - PHP_EXTRA_VERSION="-polyscripted" \ \ # bundled pcre does not support JIT on s390x # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT @@ -251,7 +250,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - ${POLYSCRIPT_PATH}/polyscript-enable; \ + ${POLYSCRIPT_PATH}/polyscript-enable \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -270,7 +269,8 @@ RUN set -eux; \ | sort -u \ | xargs -r apt-mark manual \ ; \ -# https://github.com/docker-library/php/issues/443 + \ +# update pecl channel definitions https://github.com/docker-library/php/issues/443 pecl update-channels; \ rm -rf /tmp/pear ~/.pearrc; \ # smoke test @@ -287,7 +287,6 @@ ENTRYPOINT ["docker-php-entrypoint"] STOPSIGNAL SIGWINCH COPY apache2-foreground /usr/local/bin/ - WORKDIR /var/www/html EXPOSE 80 diff --git a/7.2/stretch/apache/publish-image.sh b/7.2/stretch/apache/publish-image.sh index 9bf9b9ed96..b675507430 100755 --- a/7.2/stretch/apache/publish-image.sh +++ b/7.2/stretch/apache/publish-image.sh @@ -1,6 +1,12 @@ -#!/bin/bash +#!/bin/sh +# Copyright (c) 2020 Polyverse Corporation -image="polyverse/ps-php7.2-apache" +type="$(basename $PWD)" +build="$(basename $(dirname $PWD))" +php_ver="$(basename $(dirname $(dirname $PWD)))" +image="polyverse/ps-php${php_ver}-${build}-${type}" + +echo "Image $image being built" echo "$(date) Obtaining current git sha for tagging the docker image" headsha=$(git rev-parse --verify HEAD) @@ -9,9 +15,7 @@ echo "Building image $image:$headsha" docker build -t $image:$headsha . if [[ "$1" == "-p" ]]; then - echo "Pushing as latest tag..." - docker tag $image:$headsha $image:latest - docker push $image:latest + echo "Pushing as latest tag..." + docker tag $image:$headsha $image:latest + docker push $image:latest fi - - diff --git a/7.4/buster/apache/Dockerfile b/7.4/buster/apache/Dockerfile index 7f84616f1b..cdeccdbcf7 100644 --- a/7.4/buster/apache/Dockerfile +++ b/7.4/buster/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM polyverse/php-polyscripting-builder:latest as builder +FROM polyverse/php-polyscripting-builder:dcc0be30bb5a42de88c5c17e0a3ef90e69209575 as builder # # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" # @@ -18,11 +18,10 @@ RUN set -eux; \ # dependencies required for running "phpize" # (see persistent deps below) -ENV PHPIZE_DEPS \ +ENV PHPIZE_DEPS bison \ autoconf \ dpkg-dev \ file \ - vim \ g++ \ gcc \ libc-dev \ @@ -38,8 +37,6 @@ RUN set -eux; \ ca-certificates \ curl \ xz-utils \ - bison \ - libxml2-dev \ ; \ rm -rf /var/lib/apt/lists/* @@ -112,7 +109,7 @@ RUN { \ && a2enconf docker-php ENV PHP_EXTRA_BUILD_DEPS apache2-dev -ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi PHP_EXTRA_VERSION="-polyscripted" +ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi #### # Apply stack smash protection to functions using local buffers and alloca() @@ -128,9 +125,9 @@ ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" ENV GPG_KEYS 42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312 -ENV PHP_VERSION 7.4.2-polyscripted -ENV PHP_URL="https://www.php.net/get/php-7.4.2.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.4.2.tar.xz.asc/from/this/mirror" -ENV PHP_SHA256="98284deac017da0d426117ecae7599a1f1bf62ae3911e8bc16c4403a8f4bdf13" PHP_MD5="" +ENV PHP_VERSION 7.4.3 +ENV PHP_URL="https://www.php.net/get/php-7.4.3.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.4.3.tar.xz.asc/from/this/mirror" +ENV PHP_SHA256="cf1f856d877c268124ded1ede40c9fb6142b125fdaafdc54f855120b8bc6982a" PHP_MD5="" RUN set -eux; \ \ @@ -174,8 +171,6 @@ ENV PHP_SRC_PATH "/usr/src/php" WORKDIR $POLYSCRIPT_PATH COPY --from=builder /polyscripting/ ./ - - RUN set -eux; \ \ savedAptMark="$(apt-mark showmanual)"; \ @@ -240,7 +235,6 @@ RUN set -eux; \ # in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494 --with-pear \ \ - PHP_EXTRA_VERSION="-polyscripted" \ # bundled pcre does not support JIT on s390x # https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ @@ -248,7 +242,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - $POLYSCRIPT_PATH/polyscript-enable; \ + ${POLYSCRIPT_PATH}/polyscript-enable \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) @@ -267,6 +261,7 @@ RUN set -eux; \ | sort -u \ | xargs -r apt-mark manual \ ; \ + \ # update pecl channel definitions https://github.com/docker-library/php/issues/443 pecl update-channels; \ rm -rf /tmp/pear ~/.pearrc; \ diff --git a/7.4/buster/apache/publish-image.sh b/7.4/buster/apache/publish-image.sh index 347bfb9c14..68fd606fa4 100755 --- a/7.4/buster/apache/publish-image.sh +++ b/7.4/buster/apache/publish-image.sh @@ -1,18 +1,21 @@ -#!/bin/sh +#!/bin/bash +# Copyright (c) 2020 Polyverse Corporation -image="polyverse/ps-php7.4-apache" +type="$(basename $PWD)" +build="$(basename $(dirname $PWD))" +php_ver="$(basename $(dirname $(dirname $PWD)))" +image="polyverse/ps-php${php_ver}-${build}-${type}" + +echo "Image $image being built" echo "$(date) Obtaining current git sha for tagging the docker image" headsha=$(git rev-parse --verify HEAD) - +echo "Building image $image:$headsha" docker build -t $image:$headsha . if [[ "$1" == "-p" ]]; then - docker push $image:$headsha - echo "Pushing as latest tag..." - docker tag $image:$headsha $image:latest - docker push $image:latest + echo "Pushing as latest tag..." + docker tag $image:$headsha $image:latest + docker push $image:latest fi - - diff --git a/polyscripting/CONTRIBUTING.md b/polyscripting/CONTRIBUTING.md new file mode 100644 index 0000000000..5a760ca921 --- /dev/null +++ b/polyscripting/CONTRIBUTING.md @@ -0,0 +1,4 @@ + All code under this directory is proprietary and copyrighted by Polyverse Corporation. In order to contribute, + you must sign a Contributor License Agreement. + + To get started, sign the Contributor License Agreement. \ No newline at end of file diff --git a/polyscripting/Dockerfile b/polyscripting/Dockerfile index 84dc7fc188..b1a116ef9d 100644 --- a/polyscripting/Dockerfile +++ b/polyscripting/Dockerfile @@ -1,3 +1,4 @@ +# Copyright (c) 2020 Polyverse Corporation FROM golang COPY src/tokenizer /polyscripting/ diff --git a/polyscripting/LICENSE b/polyscripting/LICENSE new file mode 100644 index 0000000000..08b1a4668b --- /dev/null +++ b/polyscripting/LICENSE @@ -0,0 +1,7 @@ +All code under this directory is Polyverse copyrighted and +quite simply, Proprietary. Not offered under any license at +the moment. We are working on an appropriate license as we speak. + +In the meantime, please contact Polyverse at support@polyverse.com. + + diff --git a/polyscripting/build.sh b/polyscripting/build.sh index 4ffd822835..6f98cf19bd 100755 --- a/polyscripting/build.sh +++ b/polyscripting/build.sh @@ -1,4 +1,5 @@ #!/bin/sh +# Copyright (c) 2020 Polyverse Corporation image="polyverse/php-polyscripting-builder" diff --git a/polyscripting/lambda/build-scrambled-lambda.sh b/polyscripting/lambda/build-scrambled-lambda.sh index 9e0322533e..1c74acc573 100755 --- a/polyscripting/lambda/build-scrambled-lambda.sh +++ b/polyscripting/lambda/build-scrambled-lambda.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Copyright (c) 2020 Polyverse Corporation copy_dependencies() { cp -n $PHP_EXEC/php $PHP_EXEC/s_php diff --git a/polyscripting/run.sh b/polyscripting/run.sh index f8294fd1ed..d5e846897d 100755 --- a/polyscripting/run.sh +++ b/polyscripting/run.sh @@ -1,4 +1,5 @@ #!/bin/sh +# Copyright (c) 2020 Polyverse Corporation image="polyverse/php-polyscripting-builder" headsha=$(git rev-parse --verify HEAD) diff --git a/polyscripting/scripts/build-scrambled.sh b/polyscripting/scripts/build-scrambled.sh index 305ccbc7ee..69602636ee 100755 --- a/polyscripting/scripts/build-scrambled.sh +++ b/polyscripting/scripts/build-scrambled.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Copyright (c) 2020 Polyverse Corporation if [ ! -v PHP_EXEC ]; then PHP_EXEC=/usr/local/bin diff --git a/polyscripting/scripts/polyscript-enable b/polyscripting/scripts/polyscript-enable index 50f4e7cc13..51faa621c9 100755 --- a/polyscripting/scripts/polyscript-enable +++ b/polyscripting/scripts/polyscript-enable @@ -1,4 +1,5 @@ #!/bin/bash +# Copyright (c) 2020 Polyverse Corporation sed -i '/^PHP_EXTRA_VERSION/s/"$/-poly"/' configure configure.ac Makefile sed -i '/PHP_EXTRA_VERSION/s/""/"-poly"/' main/php_version.h diff --git a/polyscripting/src/scrambler/dictionaryHandler.go b/polyscripting/src/scrambler/dictionaryHandler.go index 049a54248c..ef99a1f5a4 100644 --- a/polyscripting/src/scrambler/dictionaryHandler.go +++ b/polyscripting/src/scrambler/dictionaryHandler.go @@ -1,3 +1,5 @@ +// Copyright (c) 2020 Polyverse Corporation + package main import ( diff --git a/polyscripting/src/scrambler/randomizeString.go b/polyscripting/src/scrambler/randomizeString.go index 3e2fa80328..91cb1098c3 100644 --- a/polyscripting/src/scrambler/randomizeString.go +++ b/polyscripting/src/scrambler/randomizeString.go @@ -1,3 +1,5 @@ +// Copyright (c) 2020 Polyverse Corporation + package main import ( diff --git a/polyscripting/src/scrambler/scrambler.go b/polyscripting/src/scrambler/scrambler.go index 7fbd7a371e..29bb987edb 100644 --- a/polyscripting/src/scrambler/scrambler.go +++ b/polyscripting/src/scrambler/scrambler.go @@ -1,3 +1,5 @@ +// Copyright (c) 2020 Polyverse Corporation + package main //TODO: CLEAN UP, REFACTOR diff --git a/polyscripting/src/tokenizer/snip-transform.php b/polyscripting/src/tokenizer/snip-transform.php index 0291db3297..27d7e8a618 100644 --- a/polyscripting/src/tokenizer/snip-transform.php +++ b/polyscripting/src/tokenizer/snip-transform.php @@ -1,5 +1,6 @@ temp.txt -sed "/${flag}/q" $dockerfile >> temp.txt +sed -e "/${flag}/q" -e 's#ENV PHPIZE_DEPS#ENV PHPIZE_DEPS bison#' $dockerfile >> temp.txt echo "$enable" >> temp.txt grep -v -e 'make -j "$(nproc)";' \ -e 'make clean;' \ diff --git a/polyscripting/tools/publish-all.sh b/polyscripting/tools/publish-all.sh index b017cc15aa..73a1a73eec 100755 --- a/polyscripting/tools/publish-all.sh +++ b/polyscripting/tools/publish-all.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Copyright (c) 2020 Polyverse Corporation cd .. ./build.sh -p diff --git a/polyscripting/tools/publish-image.sh b/polyscripting/tools/publish-image.sh index 6dbeff2ed5..68fd606fa4 100755 --- a/polyscripting/tools/publish-image.sh +++ b/polyscripting/tools/publish-image.sh @@ -1,4 +1,5 @@ -#!/bin/sh +#!/bin/bash +# Copyright (c) 2020 Polyverse Corporation type="$(basename $PWD)" build="$(basename $(dirname $PWD))" @@ -12,8 +13,6 @@ headsha=$(git rev-parse --verify HEAD) echo "Building image $image:$headsha" docker build -t $image:$headsha . -docker push $image:$headsha - if [[ "$1" == "-p" ]]; then echo "Pushing as latest tag..." From d8327c7252517fe297aa0b4b48e336cd8d8f9c39 Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Thu, 12 Mar 2020 14:17:01 -0700 Subject: [PATCH 02/14] fixed script, tested wordpress downstream. --- polyscripting/tools/dockerfile-builder.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polyscripting/tools/dockerfile-builder.sh b/polyscripting/tools/dockerfile-builder.sh index 5c77371369..b0d5424157 100755 --- a/polyscripting/tools/dockerfile-builder.sh +++ b/polyscripting/tools/dockerfile-builder.sh @@ -38,14 +38,14 @@ echo "No polyscritping builder found, adding polyscripting to Dockerfile" flag="COPY docker-php-source \/usr\/local\/bin\/" echo "FROM polyverse/php-polyscripting-builder:$headsha as builder" > temp.txt -sed -e "/${flag}/q" -e 's#ENV PHPIZE_DEPS#ENV PHPIZE_DEPS bison#' $dockerfile >> temp.txt +sed -e "/${flag}/q" -e 's#ENV PHPIZE_DEPS#ENV PHPIZE_DEPS bison bash#' $dockerfile >> temp.txt echo "$enable" >> temp.txt grep -v -e 'make -j "$(nproc)";' \ -e 'make clean;' \ -e 'docker-php-source delete;' \ -e 'find -type f -name' \ -e 'apt-get purge -y --auto-remove' \ - <(sed -e 's#make install;#\${POLYSCRIPT_PATH}/polyscript-enable#' \ + <(sed -e 's#make install;#\${POLYSCRIPT_PATH}/polyscript-enable;#' \ <(awk "f;/${flag}/{f=1}" $dockerfile)) >> temp.txt mv temp.txt $dockerfile From 1b5fb0089973c9db7f4071cb41b2f71731a6f6b3 Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Wed, 18 Mar 2020 14:17:05 -0700 Subject: [PATCH 03/14] normalizing --- 7.2/alpine3.11/fpm/Dockerfile | 8 ++++---- 7.2/stretch/apache/Dockerfile | 8 ++++---- 7.4/buster/apache/Dockerfile | 8 ++++---- polyscripting/tools/dockerfile-builder.sh | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/7.2/alpine3.11/fpm/Dockerfile b/7.2/alpine3.11/fpm/Dockerfile index e880c97c19..be961b8430 100644 --- a/7.2/alpine3.11/fpm/Dockerfile +++ b/7.2/alpine3.11/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM polyverse/php-polyscripting-builder:dcc0be30bb5a42de88c5c17e0a3ef90e69209575 as builder +FROM polyverse/php-polyscripting-builder:d8327c7252517fe297aa0b4b48e336cd8d8f9c39 as polyscripter # # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" # @@ -9,7 +9,7 @@ FROM alpine:3.11 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS bison \ +ENV PHPIZE_DEPS bison bash \ autoconf \ dpkg-dev dpkg \ file \ @@ -103,7 +103,7 @@ COPY docker-php-source /usr/local/bin/ ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting" ENV PHP_SRC_PATH "/usr/src/php" WORKDIR $POLYSCRIPT_PATH -COPY --from=builder /polyscripting/ ./ +COPY --from=polyscripter /polyscripting/ ./ RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -161,7 +161,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - ${POLYSCRIPT_PATH}/polyscript-enable \ + ${POLYSCRIPT_PATH}/polyscript-enable; \ find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.2/stretch/apache/Dockerfile b/7.2/stretch/apache/Dockerfile index 87aeb0869e..fef449b606 100644 --- a/7.2/stretch/apache/Dockerfile +++ b/7.2/stretch/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM polyverse/php-polyscripting-builder:dcc0be30bb5a42de88c5c17e0a3ef90e69209575 as builder +FROM polyverse/php-polyscripting-builder:d8327c7252517fe297aa0b4b48e336cd8d8f9c39 as polyscripter # # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" # @@ -18,7 +18,7 @@ RUN set -eux; \ # dependencies required for running "phpize" # (see persistent deps below) -ENV PHPIZE_DEPS bison \ +ENV PHPIZE_DEPS bison bash \ autoconf \ dpkg-dev \ file \ @@ -169,7 +169,7 @@ COPY docker-php-source /usr/local/bin/ ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting" ENV PHP_SRC_PATH "/usr/src/php" WORKDIR $POLYSCRIPT_PATH -COPY --from=builder /polyscripting/ ./ +COPY --from=polyscripter /polyscripting/ ./ RUN set -eux; \ \ @@ -250,7 +250,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - ${POLYSCRIPT_PATH}/polyscript-enable \ + ${POLYSCRIPT_PATH}/polyscript-enable; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/7.4/buster/apache/Dockerfile b/7.4/buster/apache/Dockerfile index cdeccdbcf7..1814ff03c7 100644 --- a/7.4/buster/apache/Dockerfile +++ b/7.4/buster/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM polyverse/php-polyscripting-builder:dcc0be30bb5a42de88c5c17e0a3ef90e69209575 as builder +FROM polyverse/php-polyscripting-builder:d8327c7252517fe297aa0b4b48e336cd8d8f9c39 as polyscripter # # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" # @@ -18,7 +18,7 @@ RUN set -eux; \ # dependencies required for running "phpize" # (see persistent deps below) -ENV PHPIZE_DEPS bison \ +ENV PHPIZE_DEPS bison bash \ autoconf \ dpkg-dev \ file \ @@ -169,7 +169,7 @@ COPY docker-php-source /usr/local/bin/ ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting" ENV PHP_SRC_PATH "/usr/src/php" WORKDIR $POLYSCRIPT_PATH -COPY --from=builder /polyscripting/ ./ +COPY --from=polyscripter /polyscripting/ ./ RUN set -eux; \ \ @@ -242,7 +242,7 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - ${POLYSCRIPT_PATH}/polyscript-enable \ + ${POLYSCRIPT_PATH}/polyscript-enable; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) diff --git a/polyscripting/tools/dockerfile-builder.sh b/polyscripting/tools/dockerfile-builder.sh index b0d5424157..3e84a07be3 100755 --- a/polyscripting/tools/dockerfile-builder.sh +++ b/polyscripting/tools/dockerfile-builder.sh @@ -20,7 +20,7 @@ enable=$(cat <<-'Message' ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting" ENV PHP_SRC_PATH "/usr/src/php" WORKDIR $POLYSCRIPT_PATH -COPY --from=builder /polyscripting/ ./ +COPY --from=polyscripter /polyscripting/ ./ Message ) @@ -37,7 +37,7 @@ fi echo "No polyscritping builder found, adding polyscripting to Dockerfile" flag="COPY docker-php-source \/usr\/local\/bin\/" -echo "FROM polyverse/php-polyscripting-builder:$headsha as builder" > temp.txt +echo "FROM polyverse/php-polyscripting-builder:$headsha as polyscripter" > temp.txt sed -e "/${flag}/q" -e 's#ENV PHPIZE_DEPS#ENV PHPIZE_DEPS bison bash#' $dockerfile >> temp.txt echo "$enable" >> temp.txt grep -v -e 'make -j "$(nproc)";' \ From 3c6b6ea8c7e2cbb7a04cdff71a65186a28d1c66f Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Fri, 3 Apr 2020 09:28:43 -0700 Subject: [PATCH 04/14] updated lambda --- polyscripting/Dockerfile | 1 + .../lambda/{build-scrambled-lambda.sh => build-scrambled.sh} | 0 2 files changed, 1 insertion(+) rename polyscripting/lambda/{build-scrambled-lambda.sh => build-scrambled.sh} (100%) diff --git a/polyscripting/Dockerfile b/polyscripting/Dockerfile index b1a116ef9d..88439132a3 100644 --- a/polyscripting/Dockerfile +++ b/polyscripting/Dockerfile @@ -3,6 +3,7 @@ FROM golang COPY src/tokenizer /polyscripting/ COPY scripts /polyscripting/ +COPY /lambda /lambda COPY ./src/scrambler/* /go/src/github.com/polyverse/scrambler/ diff --git a/polyscripting/lambda/build-scrambled-lambda.sh b/polyscripting/lambda/build-scrambled.sh similarity index 100% rename from polyscripting/lambda/build-scrambled-lambda.sh rename to polyscripting/lambda/build-scrambled.sh From e8f434e150764a1706a00a4692082df608d5b67e Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Wed, 13 May 2020 21:40:19 -0700 Subject: [PATCH 05/14] updating git shas --- 7.2/alpine3.11/fpm/publish-image.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/7.2/alpine3.11/fpm/publish-image.sh b/7.2/alpine3.11/fpm/publish-image.sh index 68fd606fa4..9e0fc7cfa6 100755 --- a/7.2/alpine3.11/fpm/publish-image.sh +++ b/7.2/alpine3.11/fpm/publish-image.sh @@ -1,4 +1,10 @@ #!/bin/bash + +echo "HERE WE GO" +echo "fdafdsfasdfsadfsdafdsafdsafafdsafdsafdsafdsafsadfdsafsdafdsaf \ + fdafdsafsdfsadfsafsdafsadfasdf \ + dfasdfsdafasdfdsafsdafadsfasdf \n fdsafdsfasdfdsa fdsafsafsadfads \nhhhhhh" + # Copyright (c) 2020 Polyverse Corporation type="$(basename $PWD)" @@ -18,4 +24,5 @@ if [[ "$1" == "-p" ]]; then echo "Pushing as latest tag..." docker tag $image:$headsha $image:latest docker push $image:latest + docker push $image:$headsha fi From 55746a4e81993c244cfd98acbad1a8ff307cacf2 Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Wed, 13 May 2020 21:41:34 -0700 Subject: [PATCH 06/14] updating git shas --- 7.2/stretch/apache/publish-image.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/7.2/stretch/apache/publish-image.sh b/7.2/stretch/apache/publish-image.sh index b675507430..6e2c53fc5b 100755 --- a/7.2/stretch/apache/publish-image.sh +++ b/7.2/stretch/apache/publish-image.sh @@ -18,4 +18,5 @@ if [[ "$1" == "-p" ]]; then echo "Pushing as latest tag..." docker tag $image:$headsha $image:latest docker push $image:latest + docker push $image:$headsha fi From bba9927d5e4c7636b200c663070bacb6aecdc509 Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Wed, 13 May 2020 21:42:24 -0700 Subject: [PATCH 07/14] updating git shas --- 7.4/buster/apache/publish-image.sh | 1 + polyscripting/tools/publish-all.sh | 7 ++++--- polyscripting/tools/publish-image.sh | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/7.4/buster/apache/publish-image.sh b/7.4/buster/apache/publish-image.sh index 68fd606fa4..a86af41f8a 100755 --- a/7.4/buster/apache/publish-image.sh +++ b/7.4/buster/apache/publish-image.sh @@ -18,4 +18,5 @@ if [[ "$1" == "-p" ]]; then echo "Pushing as latest tag..." docker tag $image:$headsha $image:latest docker push $image:latest + docker push $image:$headsha fi diff --git a/polyscripting/tools/publish-all.sh b/polyscripting/tools/publish-all.sh index 73a1a73eec..17bb472593 100755 --- a/polyscripting/tools/publish-all.sh +++ b/polyscripting/tools/publish-all.sh @@ -1,8 +1,8 @@ #!/bin/bash # Copyright (c) 2020 Polyverse Corporation - +set -ex cd .. -./build.sh -p +#./build.sh -p cd .. ROOT=$PWD @@ -13,6 +13,7 @@ echo "Building and pushing all polyscripted php images tagged with current gitsh for d in $FILES; do cd $d echo "building and publishing $d" - ./publish-image.sh -p + ./publish-image.sh -p > /dev/null cd $ROOT + echo $PWD done diff --git a/polyscripting/tools/publish-image.sh b/polyscripting/tools/publish-image.sh index 68fd606fa4..a86af41f8a 100755 --- a/polyscripting/tools/publish-image.sh +++ b/polyscripting/tools/publish-image.sh @@ -18,4 +18,5 @@ if [[ "$1" == "-p" ]]; then echo "Pushing as latest tag..." docker tag $image:$headsha $image:latest docker push $image:latest + docker push $image:$headsha fi From f164acde543589d361af9a453d19a3e998b38768 Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Wed, 13 May 2020 23:24:11 -0700 Subject: [PATCH 08/14] adding publish all script to root --- 7.2/alpine3.11/fpm/Dockerfile | 13 ++++++------- 7.2/stretch/apache/Dockerfile | 2 +- 7.4/buster/apache/Dockerfile | 2 +- polyscript-publish-all.sh | 19 +++++++++++++++++++ polyscripting/tools/dockerfile-builder.sh | 4 ++-- polyscripting/tools/publish-all.sh | 2 +- 6 files changed, 30 insertions(+), 12 deletions(-) create mode 100755 polyscript-publish-all.sh diff --git a/7.2/alpine3.11/fpm/Dockerfile b/7.2/alpine3.11/fpm/Dockerfile index be961b8430..465f2eb073 100644 --- a/7.2/alpine3.11/fpm/Dockerfile +++ b/7.2/alpine3.11/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM polyverse/php-polyscripting-builder:d8327c7252517fe297aa0b4b48e336cd8d8f9c39 as polyscripter +FROM polyverse/php-polyscripting-builder:latest as polyscripter # # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" # @@ -55,18 +55,17 @@ ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-gr # Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) # Enable optimization (-O2) # Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) # https://github.com/docker-library/php/issues/272 # -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php) ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" +ENV PHP_LDFLAGS="-Wl,-O1 -pie" ENV GPG_KEYS 1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F -ENV PHP_VERSION 7.2.28 -ENV PHP_URL="https://www.php.net/get/php-7.2.28.tar.xz/from/this/mirror" PHP_ASC_URL="https://www.php.net/get/php-7.2.28.tar.xz.asc/from/this/mirror" -ENV PHP_SHA256="afe1863301da572dee2e0bad8014813bcced162f980ddc8ec8e41fd72263eb2d" PHP_MD5="" +ENV PHP_VERSION 7.2.30 +ENV PHP_URL="https://www.php.net/distributions/php-7.2.30.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-7.2.30.tar.xz.asc" +ENV PHP_SHA256="aa93df27b58a45d6c9800ac813245dfdca03490a918ebe515b3a70189b1bf8c3" PHP_MD5="" RUN set -eux; \ \ @@ -130,7 +129,7 @@ RUN set -eux; \ --with-config-file-path="$PHP_INI_DIR" \ --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ \ -# make sure invalid --configure-flags are fatal errors intead of just warnings +# make sure invalid --configure-flags are fatal errors instead of just warnings --enable-option-checking=fatal \ \ # https://github.com/docker-library/php/issues/439 diff --git a/7.2/stretch/apache/Dockerfile b/7.2/stretch/apache/Dockerfile index fef449b606..56e9161eea 100644 --- a/7.2/stretch/apache/Dockerfile +++ b/7.2/stretch/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM polyverse/php-polyscripting-builder:d8327c7252517fe297aa0b4b48e336cd8d8f9c39 as polyscripter +FROM polyverse/php-polyscripting-builder:latest as polyscripter # # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" # diff --git a/7.4/buster/apache/Dockerfile b/7.4/buster/apache/Dockerfile index 1814ff03c7..7164872c0e 100644 --- a/7.4/buster/apache/Dockerfile +++ b/7.4/buster/apache/Dockerfile @@ -1,4 +1,4 @@ -FROM polyverse/php-polyscripting-builder:d8327c7252517fe297aa0b4b48e336cd8d8f9c39 as polyscripter +FROM polyverse/php-polyscripting-builder:latest as polyscripter # # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" # diff --git a/polyscript-publish-all.sh b/polyscript-publish-all.sh new file mode 100755 index 0000000000..89c0595502 --- /dev/null +++ b/polyscript-publish-all.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright (c) 2020 Polyverse Corporation +set -ex +ROOT=$PWD +cd ./polyscripting +./build.sh -p +cd $ROOT + +FILES=$(find . -path ./polyscripting -prune -o -type f -name 'publish-image.sh' -print | sed -E 's|/[^/]+$||' |uniq) + +echo $FILES +echo "Building and pushing all polyscripted php images tagged with current gitsha." +for d in $FILES; do + cd $d + echo "building and publishing $d" + ./publish-image.sh -p > /dev/null + cd $ROOT + echo $PWD +done diff --git a/polyscripting/tools/dockerfile-builder.sh b/polyscripting/tools/dockerfile-builder.sh index 3e84a07be3..607be826ef 100755 --- a/polyscripting/tools/dockerfile-builder.sh +++ b/polyscripting/tools/dockerfile-builder.sh @@ -11,8 +11,8 @@ if [[ ! $(basename $1) == "Dockerfile" ]]; then exit 1 fi -line="FROM polyverse/php-polyscripting-builder:$headsha as builder" -pattern="FROM polyverse\/php-polyscripting-builder:$headsha as builder" +line="FROM polyverse/php-polyscripting-builder:latest as builder" +pattern="FROM polyverse\/php-polyscripting-builder:latest as builder" enable=$(cat <<-'Message' diff --git a/polyscripting/tools/publish-all.sh b/polyscripting/tools/publish-all.sh index 17bb472593..63da0f3a04 100755 --- a/polyscripting/tools/publish-all.sh +++ b/polyscripting/tools/publish-all.sh @@ -6,7 +6,7 @@ cd .. cd .. ROOT=$PWD -FILES=$(find . -name polyscripting -prune -o -type f -name '*publish-image.sh*' | sed -E 's|/[^/]+$||' |uniq) +FILES=$(find . -path ./polyscripting -prune -o -type f -name 'publish-image.sh' -print | sed -E 's|/[^/]+$||' |uniq) echo $FILES echo "Building and pushing all polyscripted php images tagged with current gitsha." From 6667e1c602f6ce354542cf4fd69a57888841dfd8 Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Wed, 13 May 2020 23:26:02 -0700 Subject: [PATCH 09/14] add action --- .github/workflows | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows diff --git a/.github/workflows b/.github/workflows new file mode 100644 index 0000000000..f9e996d238 --- /dev/null +++ b/.github/workflows @@ -0,0 +1,13 @@ +name: Publish all php docker images +on: [push] +jobs: + login: + runs-on: ubuntu-latest + steps: + - uses: azure/docker-login@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Publish All + run: ./polyscript-publish-all.sh + shell: bash From 9c68c7ecec28529cc5300c53081ac9f93c869695 Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Wed, 13 May 2020 23:29:06 -0700 Subject: [PATCH 10/14] add actions --- .github/{workflows => workflows/main.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => workflows/main.yml} (100%) diff --git a/.github/workflows b/.github/workflows/main.yml similarity index 100% rename from .github/workflows rename to .github/workflows/main.yml From d799c25cef9989f0b335261323c89bcd38a3b124 Mon Sep 17 00:00:00 2001 From: Blue <40182784+truestblue@users.noreply.github.com> Date: Wed, 13 May 2020 23:30:58 -0700 Subject: [PATCH 11/14] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9e996d238..c8fac5cb52 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,8 @@ jobs: login: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v1 - uses: azure/docker-login@v1 with: username: ${{ secrets.DOCKER_USERNAME }} From 83b6acbd026946d92417b23fc4e919f5c56d54c6 Mon Sep 17 00:00:00 2001 From: Blue <40182784+truestblue@users.noreply.github.com> Date: Wed, 13 May 2020 23:33:18 -0700 Subject: [PATCH 12/14] Update main.yml --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8fac5cb52..303892559d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,5 +11,6 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Publish All - run: ./polyscript-publish-all.sh + run: ./publish-all.sh shell: bash + working-directory: ./polyscripting/tools/ From 549b08596a1669f4d39f2cb915f4e297ef6b6770 Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Thu, 14 May 2020 00:01:12 -0700 Subject: [PATCH 13/14] removed root publish dir and updated action --- polyscript-publish-all.sh | 19 ------------------- polyscripting/tools/publish-all.sh | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100755 polyscript-publish-all.sh diff --git a/polyscript-publish-all.sh b/polyscript-publish-all.sh deleted file mode 100755 index 89c0595502..0000000000 --- a/polyscript-publish-all.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Copyright (c) 2020 Polyverse Corporation -set -ex -ROOT=$PWD -cd ./polyscripting -./build.sh -p -cd $ROOT - -FILES=$(find . -path ./polyscripting -prune -o -type f -name 'publish-image.sh' -print | sed -E 's|/[^/]+$||' |uniq) - -echo $FILES -echo "Building and pushing all polyscripted php images tagged with current gitsha." -for d in $FILES; do - cd $d - echo "building and publishing $d" - ./publish-image.sh -p > /dev/null - cd $ROOT - echo $PWD -done diff --git a/polyscripting/tools/publish-all.sh b/polyscripting/tools/publish-all.sh index 63da0f3a04..9d1bca4bd6 100755 --- a/polyscripting/tools/publish-all.sh +++ b/polyscripting/tools/publish-all.sh @@ -13,7 +13,7 @@ echo "Building and pushing all polyscripted php images tagged with current gitsh for d in $FILES; do cd $d echo "building and publishing $d" - ./publish-image.sh -p > /dev/null + ./publish-image.sh -p cd $ROOT echo $PWD done From ca66c9dcda976d985440e2e51d420ac549eb2d7e Mon Sep 17 00:00:00 2001 From: Blue Gaston Date: Sun, 6 Dec 2020 20:55:26 -0800 Subject: [PATCH 14/14] Updated to include addtional php versions --- 7.4/alpine3.11/fpm/Dockerfile | 17 ++++++++++------- 7.4/alpine3.11/fpm/publish-image.sh | 21 +++++++++++++++++++++ 7.4/buster/apache/Dockerfile | 19 +++---------------- 7.4/buster/fpm/Dockerfile | 16 +++++++++------- 7.4/buster/fpm/publish-image.sh | 21 +++++++++++++++++++++ polyscripting/tools/build-all.sh | 18 ++++++++++++++++++ 6 files changed, 82 insertions(+), 30 deletions(-) create mode 100755 7.4/alpine3.11/fpm/publish-image.sh create mode 100755 7.4/buster/fpm/publish-image.sh create mode 100755 polyscripting/tools/build-all.sh diff --git a/7.4/alpine3.11/fpm/Dockerfile b/7.4/alpine3.11/fpm/Dockerfile index 56074d029c..5e7f3b12ed 100644 --- a/7.4/alpine3.11/fpm/Dockerfile +++ b/7.4/alpine3.11/fpm/Dockerfile @@ -1,3 +1,4 @@ +FROM polyverse/php-polyscripting-builder:3c6b6ea8c7e2cbb7a04cdff71a65186a28d1c66f as polyscripter # # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" # @@ -8,7 +9,7 @@ FROM alpine:3.11 # dependencies required for running "phpize" # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) -ENV PHPIZE_DEPS \ +ENV PHPIZE_DEPS bison bash \ autoconf \ dpkg-dev dpkg \ file \ @@ -98,6 +99,12 @@ RUN set -eux; \ COPY docker-php-source /usr/local/bin/ +#add polyscripting +ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting" +ENV PHP_SRC_PATH "/usr/src/php" +WORKDIR $POLYSCRIPT_PATH +COPY --from=polyscripter /polyscripting/ ./ + RUN set -eux; \ apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS \ @@ -159,17 +166,13 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ + ${POLYSCRIPT_PATH}/polyscript-enable; \ find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; \ - make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) cp -v php.ini-* "$PHP_INI_DIR/"; \ \ cd /; \ - docker-php-source delete; \ \ runDeps="$( \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ @@ -240,4 +243,4 @@ STOPSIGNAL SIGQUIT EXPOSE 9000 CMD ["php-fpm"] -#### \ No newline at end of file +#### diff --git a/7.4/alpine3.11/fpm/publish-image.sh b/7.4/alpine3.11/fpm/publish-image.sh new file mode 100755 index 0000000000..68fd606fa4 --- /dev/null +++ b/7.4/alpine3.11/fpm/publish-image.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright (c) 2020 Polyverse Corporation + +type="$(basename $PWD)" +build="$(basename $(dirname $PWD))" +php_ver="$(basename $(dirname $(dirname $PWD)))" +image="polyverse/ps-php${php_ver}-${build}-${type}" + +echo "Image $image being built" + +echo "$(date) Obtaining current git sha for tagging the docker image" +headsha=$(git rev-parse --verify HEAD) + +echo "Building image $image:$headsha" +docker build -t $image:$headsha . + +if [[ "$1" == "-p" ]]; then + echo "Pushing as latest tag..." + docker tag $image:$headsha $image:latest + docker push $image:latest +fi diff --git a/7.4/buster/apache/Dockerfile b/7.4/buster/apache/Dockerfile index 1814ff03c7..34e01cbe30 100644 --- a/7.4/buster/apache/Dockerfile +++ b/7.4/buster/apache/Dockerfile @@ -268,19 +268,6 @@ RUN set -eux; \ # smoke test php --version -COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ - -# sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) -RUN docker-php-ext-enable sodium - -ENTRYPOINT ["docker-php-entrypoint"] -#### -# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop -STOPSIGNAL SIGWINCH - -COPY apache2-foreground /usr/local/bin/ -WORKDIR /var/www/html - -EXPOSE 80 -CMD ["apache2-foreground"] -#### +RUN set -eux; \ + apt-get update; \ + apt-get install -y vim; diff --git a/7.4/buster/fpm/Dockerfile b/7.4/buster/fpm/Dockerfile index e5426db504..c3117346a5 100644 --- a/7.4/buster/fpm/Dockerfile +++ b/7.4/buster/fpm/Dockerfile @@ -1,3 +1,4 @@ +FROM polyverse/php-polyscripting-builder:3c6b6ea8c7e2cbb7a04cdff71a65186a28d1c66f as polyscripter # # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" # @@ -17,7 +18,7 @@ RUN set -eux; \ # dependencies required for running "phpize" # (see persistent deps below) -ENV PHPIZE_DEPS \ +ENV PHPIZE_DEPS bison bash \ autoconf \ dpkg-dev \ file \ @@ -105,6 +106,12 @@ RUN set -eux; \ COPY docker-php-source /usr/local/bin/ +#add polyscripting +ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting" +ENV PHP_SRC_PATH "/usr/src/php" +WORKDIR $POLYSCRIPT_PATH +COPY --from=polyscripter /polyscripting/ ./ + RUN set -eux; \ \ savedAptMark="$(apt-mark showmanual)"; \ @@ -176,17 +183,13 @@ RUN set -eux; \ \ ${PHP_EXTRA_CONFIGURE_ARGS:-} \ ; \ - make -j "$(nproc)"; \ - find -type f -name '*.a' -delete; \ - make install; \ + ${POLYSCRIPT_PATH}/polyscript-enable; \ find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ \ # https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) cp -v php.ini-* "$PHP_INI_DIR/"; \ \ cd /; \ - docker-php-source delete; \ \ # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies apt-mark auto '.*' > /dev/null; \ @@ -199,7 +202,6 @@ RUN set -eux; \ | sort -u \ | xargs -r apt-mark manual \ ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ \ # update pecl channel definitions https://github.com/docker-library/php/issues/443 pecl update-channels; \ diff --git a/7.4/buster/fpm/publish-image.sh b/7.4/buster/fpm/publish-image.sh new file mode 100755 index 0000000000..68fd606fa4 --- /dev/null +++ b/7.4/buster/fpm/publish-image.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright (c) 2020 Polyverse Corporation + +type="$(basename $PWD)" +build="$(basename $(dirname $PWD))" +php_ver="$(basename $(dirname $(dirname $PWD)))" +image="polyverse/ps-php${php_ver}-${build}-${type}" + +echo "Image $image being built" + +echo "$(date) Obtaining current git sha for tagging the docker image" +headsha=$(git rev-parse --verify HEAD) + +echo "Building image $image:$headsha" +docker build -t $image:$headsha . + +if [[ "$1" == "-p" ]]; then + echo "Pushing as latest tag..." + docker tag $image:$headsha $image:latest + docker push $image:latest +fi diff --git a/polyscripting/tools/build-all.sh b/polyscripting/tools/build-all.sh new file mode 100755 index 0000000000..5d7c7d5894 --- /dev/null +++ b/polyscripting/tools/build-all.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright (c) 2020 Polyverse Corporation + +cd .. +./build.sh +cd .. + +ROOT=$PWD +FILES=$(find . -name polyscripting -prune -o -type f -name '*publish-image.sh*' | sed -E 's|/[^/]+$||' |uniq) + +echo $FILES +echo "Building and pushing all polyscripted php images tagged with current gitsha." +for d in $FILES; do + cd $d + echo "building and publishing $d" + ./publish-image.sh + cd $ROOT +done