官方自带的Docker脚本命令并没有带数据库MySQL的安装,因此:
- 如果你有MySQL数据库的话,那么可以直接使用官方的脚本安装。(方法一)
- 如果你没有MySQL数据库的话,那么还需要安装MySQL。(方法二)
1.方法一:Docker安装Mtab(不包含MySQL)
version: "3"
services:
mtab:
stdin_open: true
tty: true
container_name: mtab
ports:
- 9200:80
volumes:
- /vol2/1000/dockers/mtab:/app
image: itushan/mtab
restart: always
network_mode: bridge # 确保容器使用桥接网络
2. 方法二:Docker安装Mtab(包含MySQL)
version: '3.6'
services:
mysql:
image: mysql:latest
container_name: mysql
restart: unless-stopped
environment:
MYSQL_DATABASE: mtab # 数据库名称
MYSQL_ROOT_PASSWORD: 123456 # 管理员密码
TZ: Asia/Shanghai
ports:
- "3306:3306"
- "33060:33060"
volumes:
- ~/mysql/data:/var/lib/mysql # 挂载 MySQL 数据目录
networks:
- mtab_network
mtabServer:
image: itushan/mtab:latest
container_name: mtab
restart: unless-stopped
ports:
- "9200:80"
volumes:
- /vol2/1000/dockers/mtab:/app
depends_on:
- mysql
networks:
- mtab_network
networks:
mtab_network:
driver: bridge
注意:如果的外部端口3306这些被占用,那么请更换其他端口!否则,会出现如下类似的端口被专用的错误日志
![图片[1]-mtab导航Docker安装教程](https://cos.soyisou.cn/wp-content/uploads/2025/03/image.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
3. 安装配置
设置数据库和默认账号密码
![图片[2]-mtab导航Docker安装教程](https://cos.soyisou.cn/wp-content/uploads/2025/03/image-1024x532.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
设置默认账号密码,一会要用这个登录
![图片[3]-mtab导航Docker安装教程](https://cos.soyisou.cn/wp-content/uploads/2025/03/image-1-1024x700.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
显示登录成功!
![图片[4]-mtab导航Docker安装教程](https://cos.soyisou.cn/wp-content/uploads/2025/03/image-1-1024x660.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
4. 测试验证
浏览器输入http://你的ip:9200
成功进入mtab首页!
![图片[5]-mtab导航Docker安装教程](https://cos.soyisou.cn/wp-content/uploads/2025/03/image-1-1024x528.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
输入刚才注册的账号和密码
![图片[6]-mtab导航Docker安装教程](https://cos.soyisou.cn/wp-content/uploads/2025/03/image-2-1024x532.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
5. 正版授权
如果你买了正版授权码,那么可以进行授权!
如果没有正版授权码,可以联系wx:ac_java,进行获取!
![图片[7]-mtab导航Docker安装教程](https://cos.soyisou.cn/wp-content/uploads/2025/03/image-2-1024x526.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
按照提示进行操作即可!
![图片[8]-mtab导航Docker安装教程](https://cos.soyisou.cn/wp-content/uploads/2025/03/1743181296657-1024x527.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
授权成功!赶紧去使用吧!
AcJava,让技术学习更简单!
我是铭轩,微信:ac_java,欢迎与我随时交流!
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容