tpotce/docker/tanner/phpox/Dockerfile

49 lines
1.2 KiB
Text
Raw Normal View History

2020-01-03 14:06:29 +00:00
FROM alpine:3.10
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Install packages
2020-01-03 14:06:29 +00:00
RUN sed -i 's/dl-cdn/dl-2/g' /etc/apk/repositories && \
apk -U --no-cache add \
2018-05-26 23:09:31 +00:00
build-base \
file \
git \
make \
php7 \
php7-dev \
py3-pip \
2018-05-26 23:09:31 +00:00
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
2018-05-28 16:36:02 +00:00
git clone --depth=1 https://github.com/mushorg/BFR /opt/BFR && \
2018-05-26 23:09:31 +00:00
cd /opt/BFR && \
phpize7 && \
./configure \
--with-php-config=/usr/bin/php-config7 \
--enable-bfr && \
make && \
make install && \
cd / && \
rm -rf /opt/BFR /tmp/* /var/tmp/* && \
echo "zend_extension = "$(find /usr -name bfr.so) >> /etc/php7/php.ini && \
2019-08-16 14:43:10 +00:00
#
2018-05-26 23:09:31 +00:00
# Install PHP Sandbox
2018-05-28 16:36:02 +00:00
git clone --depth=1 https://github.com/mushorg/phpox /opt/phpox && \
2018-05-26 23:09:31 +00:00
cd /opt/phpox && \
pip3 install -r requirements.txt && \
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 \
php7-dev \
python3-dev && \
rm -rf /root/* && \
rm -rf /var/cache/apk/*
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"]