feat: 添加MySQL测试靶场

This commit is contained in:
ZacharyZcR 2024-12-20 19:12:46 +08:00
parent bf1b45f407
commit 92217f572f
3 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,17 @@
# 使用MySQL官方镜像
FROM mysql:latest
# 设置环境变量
ENV MYSQL_ROOT_PASSWORD=123456
ENV MYSQL_DATABASE=mydb
# 开放3306端口
EXPOSE 3306
# MySQL配置
# 允许远程访问
COPY my.cnf /etc/mysql/conf.d/my.cnf
# 健康检查
HEALTHCHECK --interval=30s --timeout=3s \
CMD mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" -e "SELECT 1" || exit 1

View File

@ -0,0 +1,5 @@
docker build -t mysql-server .
docker run -d \
-p 3306:3306 \
--name mysql-container \
mysql-server

2
TestDocker/MySQL/my.cnf Normal file
View File

@ -0,0 +1,2 @@
[mysqld]
bind-address = 0.0.0.0