docker-vulnerable-dvwa/Dockerfile

39 lines
1.0 KiB
Docker
Raw Permalink Normal View History

FROM debian:9.2
2016-08-09 14:40:03 +00:00
2017-09-09 21:48:08 +00:00
LABEL maintainer "opsxcq@strm.sh"
2016-08-09 14:40:03 +00:00
2016-12-02 19:19:11 +00:00
RUN apt-get update && \
2017-01-02 20:04:48 +00:00
apt-get upgrade -y && \
2016-12-02 19:19:11 +00:00
DEBIAN_FRONTEND=noninteractive apt-get install -y \
2017-01-02 21:03:54 +00:00
debconf-utils && \
echo mariadb-server mysql-server/root_password password vulnerables | debconf-set-selections && \
echo mariadb-server mysql-server/root_password_again password vulnerables | debconf-set-selections && \
2017-01-02 21:03:54 +00:00
DEBIAN_FRONTEND=noninteractive apt-get install -y \
2017-01-02 20:01:17 +00:00
apache2 \
mariadb-server \
php \
php-mysql \
php-pgsql \
2017-01-02 20:01:17 +00:00
php-pear \
php-gd \
2017-01-02 20:01:17 +00:00
&& \
2016-12-02 19:19:11 +00:00
apt-get clean && \
rm -rf /var/lib/apt/lists/*
2016-08-09 14:40:03 +00:00
2017-01-02 20:21:30 +00:00
COPY php.ini /etc/php5/apache2/php.ini
2017-01-02 20:01:17 +00:00
COPY dvwa /var/www/html
2016-08-09 14:40:03 +00:00
2018-10-12 16:11:19 +00:00
COPY config.inc.php /var/www/html/config/
2017-01-02 20:01:17 +00:00
RUN chown www-data:www-data -R /var/www/html && \
rm /var/www/html/index.html
2016-08-09 14:40:03 +00:00
RUN service mysql start && \
sleep 3 && \
mysql -uroot -pvulnerables -e "CREATE USER app@localhost IDENTIFIED BY 'vulnerables';CREATE DATABASE dvwa;GRANT ALL privileges ON dvwa.* TO 'app'@localhost;"
2016-12-02 19:19:11 +00:00
EXPOSE 80
2016-08-09 14:40:03 +00:00
2017-01-02 20:01:17 +00:00
COPY main.sh /
ENTRYPOINT ["/main.sh"]