1+ FROM golang
2+ WORKDIR /go/src/github.com/polyverse/
3+ COPY . .
4+ RUN git clone https://github.com/polyverse/php-scrambler.git
5+ WORKDIR ./php-scrambler
6+ RUN git checkout 8de1d48c2d410d1f3c4d02b9742dba164486c3fc
7+ RUN go get -v .
8+ RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build
9+ WORKDIR /go/src/github.com/polyverse/
10+ RUN git clone https://github.com/polyverse/tok-php-transformer.git
11+ WORKDIR ./tok-php-transformer
12+ RUN git checkout ff08cca989bd3c876955ce01f9692d7c1239af9d
13+
114#
215# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
316#
@@ -15,15 +28,20 @@ ENV PHPIZE_DEPS \
1528 g++ \
1629 gcc \
1730 libc-dev \
31+ vim \
1832 make \
1933 pkgconf \
2034 re2c
2135
2236# persistent / runtime deps
2337RUN apk add --no-cache --virtual .persistent-deps \
38+ $PHPIZE_DEPS \
2439 ca-certificates \
2540 curl \
2641 tar \
42+ bison \
43+ libxml2-dev \
44+ bash \
2745 xz \
2846# https://github.com/docker-library/php/issues/494
2947 libressl
@@ -56,12 +74,11 @@ ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie"
5674
5775ENV GPG_KEYS 1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F
5876
59- ENV PHP_VERSION 7.2.13
77+ ENV PHP_VERSION 7.2.13-polyscripted
6078ENV PHP_URL="https://secure.php.net/get/php-7.2.13.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-7.2.13.tar.xz.asc/from/this/mirror"
6179ENV PHP_SHA256="14b0429abdb46b65c843e5882c9a8c46b31dfbf279c747293b8ab950c2644a4b" PHP_MD5=""
6280
6381RUN set -xe; \
64- \
6582 apk add --no-cache --virtual .fetch-deps \
6683 gnupg \
6784 wget \
@@ -93,6 +110,9 @@ RUN set -xe; \
93110 apk del .fetch-deps
94111
95112COPY docker-php-source /usr/local/bin/
113+ COPY scripts/ /usr/local/bin/polyscripting
114+ ENV POLYSCRIPT_PATH "/usr/local/bin/polyscripting"
115+ ENV PHP_SRC_PATH "/usr/src/php"
96116
97117RUN set -xe \
98118 && apk add --no-cache --virtual .build-deps \
@@ -105,7 +125,6 @@ RUN set -xe \
105125 libsodium-dev \
106126 libxml2-dev \
107127 sqlite-dev \
108- \
109128 && export CFLAGS="$PHP_CFLAGS" \
110129 CPPFLAGS="$PHP_CPPFLAGS" \
111130 LDFLAGS="$PHP_LDFLAGS" \
@@ -138,22 +157,20 @@ RUN set -xe \
138157 --with-libedit \
139158 --with-openssl \
140159 --with-zlib \
160+ PHP_EXTRA_VERSION="-polyscripted" \
141161 \
142162# bundled pcre does not support JIT on s390x
143163# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT
144164 $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit' ) \
145165 \
146166 $PHP_EXTRA_CONFIGURE_ARGS \
147- && make -j "$(nproc)" \
148- && make install \
167+ && /usr/local/bin/polyscripting/polyscript-enable \
149168 && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
150- && make clean \
151169 \
152170# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable)
153171 && cp -v php.ini-* "$PHP_INI_DIR/" \
154172 \
155173 && cd / \
156- && docker-php-source delete \
157174 \
158175 && runDeps="$( \
159176 scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
@@ -163,17 +180,17 @@ RUN set -xe \
163180 )" \
164181 && apk add --no-cache --virtual .php-rundeps $runDeps \
165182 \
166- && apk del .build-deps \
167- \
168183# https://github.com/docker-library/php/issues/443
169184 && pecl update-channels \
170185 && rm -rf /tmp/pear ~/.pearrc
171186
187+
172188COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
173189
174190# 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)
175191RUN docker-php-ext-enable sodium
176192
193+
177194ENTRYPOINT ["docker-php-entrypoint" ]
178195# #<autogenerated>##
179196WORKDIR /var/www/html
@@ -214,6 +231,11 @@ RUN set -ex \
214231 echo 'listen = 9000' ; \
215232 } | tee php-fpm.d/zz-docker.conf
216233
234+ WORKDIR /usr/local/bin/polyscripting
235+ COPY --from=0 /go/src/github.com/polyverse/php-scrambler/php-scrambler /usr/local/bin/polyscripting
236+ COPY --from=0 /go/src/github.com/polyverse/tok-php-transformer/tok-php-transformer.php /usr/local/bin/polyscripting
237+ COPY --from=0 /go/src/github.com/polyverse/tok-php-transformer/snip-transform.php /usr/local/bin/polyscripting
238+
217239EXPOSE 9000
218240CMD ["php-fpm" ]
219241# #</autogenerated>##
0 commit comments