Note/环境/安装教程/Docker 2375端口开启外网访问.md

37 lines
630 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Docker 2375端口开启外网访问
进入服务器后
```shell
sudo vim /etc/systemd/system/multi-user.target.wants/docker.service
```
添加配置i进行插入
```shell
-H tcp://0.0.0.0
```
![image-20230901170301087](https://lsky.hhdxw.top/imghub/2023/09/iamge-202309011693558981.png)
esc :wq保存退出
然后重启docker服务
```shell
systemctl daemon-reload && systemctl restart docker
```
然后直接在命令行客户端输入如下命令IP地址改为自己的
```
curl http://IP地址:2375/version
```
或者在浏览器直接访问IP地址改为自己的
```
http://IP地址:2375/version
```