一、設置docker
1、設置暴露2375端口不使用安全傳輸層協(xié)議
Expose daemon on tcp://localhost:2375 without TLS
?2、設置配置文件暴露2375端口
"hosts": [
"tcp://0.0.0.0:2375"
]
3、重啟Docker?
?
二、設置防火墻
使用管理員打開powershell,執(zhí)行下邊命令
netsh advfirewall firewall add rule name="docker_daemon" dir=in action=allow protocol=TCP localport=2375
New-NetFirewallRule -DisplayName 'Docker SSL Inbound' -Profile @('Domain', 'Public', 'Private') -Direction Inbound -Action Allow -Protocol TCP -LocalPort 2376
三、測試
docker -H 127.0.0.1:2375 info
?瀏覽器訪問
http://localhost:2375/version
{
"Platform": {
"Name": "Docker Desktop 4.17.0 (99724)"
},
"Components": [
{
"Name": "Engine",
"Version": "20.10.23",
"Details": {
"ApiVersion": "1.41",
"Arch": "amd64",
"BuildTime": "2023-01-19T17:32:04.000000000+00:00",
"Experimental": "false",
"GitCommit": "6051f14",
"GoVersion": "go1.18.10",
"KernelVersion": "5.15.90.1-microsoft-standard-WSL2",
"MinAPIVersion": "1.12",
"Os": "linux"
}
},
{
"Name": "containerd",
"Version": "1.6.18",
"Details": {
"GitCommit": "2456e983eb9e37e47538f59ea18f2043c9a73640"
}
},
{
"Name": "runc",
"Version": "1.1.4",
"Details": {
"GitCommit": "v1.1.4-0-g5fd4c4d"
}
},
{
"Name": "docker-init",
"Version": "0.19.0",
"Details": {
"GitCommit": "de40ad0"
}
}
],
"Version": "20.10.23",
"ApiVersion": "1.41",
"MinAPIVersion": "1.12",
"GitCommit": "6051f14",
"GoVersion": "go1.18.10",
"Os": "linux",
"Arch": "amd64",
"KernelVersion": "5.15.90.1-microsoft-standard-WSL2",
"BuildTime": "2023-01-19T17:32:04.000000000+00:00"
}
?
?文章來源地址http://www.zghlxwxcb.cn/news/detail-523630.html
文章來源:http://www.zghlxwxcb.cn/news/detail-523630.html
?
到了這里,關于windows環(huán)境下的設置docker遠程訪問(開放2375端口)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!