使用 IDEA 管理 Docker
参考文章
https://www.cnblogs.com/hsz-csy/p/9488469.html
一般我们的 Docker 是安装在虚拟机或服务器上, 那首先需要将Docker的远程连接打开。
1. 设置 Docker 远程访问
vim /usr/lib/systemd/system/docker.service
在ExecStart=/usr/bin/dockerd-current 后面加上
-H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
2. IDEA 安装 Docker integration 插件
File - Settings - Plugins - 搜索 Docker | 安装 Install |
3. 连接 Docker
File - Settings - Build, Execution, Deployment - Docker - +
4. 查看 Docker 状态和信息
View - Tool Windows - Docker
如果连接超时的话, 可能是防火墙的问题。
5. 开放防火墙端口
首先查看进程
netstat -tulp
没有就先下载
yum install net-tools
防火墙开放 2375 端口。
firewall-cmd --zone=public --add-port=2375/tcp --permanent
重启防火墙
firewall-cmd --reload