一个用于快速配置 Docker Remote API 的自动化脚本,支持 Debian、Ubuntu 和 CentOS 系统。
- 自动检测和安装 Docker
- 自动配置 Docker Remote API
- 支持自定义端口
- 自动配置系统防火墙
- 配置失败自动回滚
- 支持主流 Linux 发行版:
- Debian
- Ubuntu
- CentOS
一键安装命令:
curl -sSL https://raw.githubusercontent.com/phpnbw/docker_remote_open/master/docker_remote_setup.sh -o docker_remote_setup.sh && chmod +x docker_remote_setup.sh && sudo ./docker_remote_setup.sh
使用自定义端口安装:
curl -sSL https://raw.githubusercontent.com/phpnbw/docker_remote_open/master/docker_remote_setup.sh -o docker_remote_setup.sh && chmod +x docker_remote_setup.sh && sudo ./docker_remote_setup.sh 2376
- 无参数:使用默认端口 2375
- 端口参数:指定自定义端口(1-65535)
# 使用默认端口 2375
sudo ./docker_remote_setup.sh
# 使用自定义端口 2376
sudo ./docker_remote_setup.sh 2376
Docker Remote API 默认没有认证机制,为了确保安全,建议:
- 使用防火墙限制可访问的 IP
- 配置 TLS 证书加密通信
- 使用反向代理添加认证层
- 考虑使用 VPN 或专用网络
如果遇到问题,可以查看 Docker 服务日志:
journalctl -xu docker.service
欢迎提交 Issue 和 Pull Request 来帮助改进这个项目。
MIT License
本脚本仅用于开发测试环境,在生产环境使用前请确保已经采取了适当的安全措施。作者不对因使用本脚本造成的任何损失负责。