#Docker

Docker镜像仓库在国内访问速度巨慢无比,感谢DaoCloud公司提供的稳定加速
镜像,具体的配置方法如下:

1. 修改 /etc/docker 目录下的daemon.json

如果没有/etc/docker这个目录或者/etc/docker目录下没有daemon.json文件,手动创建即可。
将daemon.json的内容修改如下:

1
2
3
{
"registry-mirrors": ["http://f1361db2.m.daocloud.io"]
}

2. 重启Docker服务

运行这两个命令:

1
2
systemctl daemon-reload
systemctl restart docker

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
FROM debian
MAINTAINER Chorder
WORKDIR /root/
ADD sources.list /etc/apt/
ADD DVWA-master.zip /root/
ADD start.sh /root/
RUN apt-get update
RUN apt-get install -y mariadb-server mariadb-client php php-mysql php-gd zip net-tools
RUN unzip /root/DVWA-master.zip -d /var/www/
RUN rm -rf /etc/apache2/sites-enabled/000-default.conf
ADD dvwa.conf /etc/apache2/sites-enabled/
RUN cp /var/www/DVWA-master/config/config.inc.php.dist /var/www/DVWA-master/config/config.inc.php
RUN sed -i 's/'root'/dvwa/g' /var/www/DVWA-master/config/config.inc.php
RUN sed -i 's/^allow_url_include.*$/allow_url_include = On/g' /etc/php/7.0/apache2/php.ini
RUN chmod 777 -R /var/www/DVWA-master
RUN chmod +x /root/start.sh
ENTRYPOINT /root/start.sh && bash
EXPOSE 80

完整的项目下载:

DVWA-Docker.tgz
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×