tpotce/docker/tanner/phpox/Dockerfile

48 lines
1.1 KiB
Text
Raw Normal View History

FROM alpine:3.19
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Install packages
2024-09-11 10:42:17 +00:00
RUN apk --no-cache -U add \
build-base \
file \
git \
make \
php83 \
php83-dev \
py3-aiohttp \
python3 \
python3-dev \
re2c && \
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Install bfr sandbox from git
git clone https://github.com/mushorg/BFR -b v1.0.0 /opt/BFR && \
2018-05-26 23:09:31 +00:00
cd /opt/BFR && \
# git checkout 91a8a4e155875c50b69d5c6af454e304994815a7 && \
phpize83 && \
2018-05-26 23:09:31 +00:00
./configure \
--with-php-config=/usr/bin/php-config83 \
2018-05-26 23:09:31 +00:00
--enable-bfr && \
make && \
make install && \
cd / && \
rm -rf /opt/BFR /tmp/* /var/tmp/* && \
echo "zend_extension = "$(find /usr -name bfr.so) >> /etc/php83/php.ini && \
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Install PHP Sandbox
2020-09-04 12:37:28 +00:00
git clone https://github.com/mushorg/phpox /opt/phpox && \
2018-05-26 23:09:31 +00:00
cd /opt/phpox && \
#git checkout a62c8136ec7b3ebab0c989f4235e2960175121f8 && \
2018-05-26 23:09:31 +00:00
make && \
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Clean up
apk del --purge build-base \
git \
php83-dev \
2018-05-26 23:09:31 +00:00
python3-dev && \
2022-03-08 23:36:03 +00:00
rm -rf /root/* /var/cache/apk/* /opt/phpox/.git
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Set workdir and start phpsandbox
2018-09-11 12:19:26 +00:00
STOPSIGNAL SIGKILL
2018-05-28 16:36:02 +00:00
USER nobody:nobody
2018-05-26 23:09:31 +00:00
WORKDIR /opt/phpox
2019-08-16 16:55:36 +00:00
CMD ["python3", "sandbox.py"]