当前位置:   article > 正文

windows环境下的设置docker远程访问(开放2375端口)_expose daemon on tcp://localhost:2375 without tls

expose daemon on tcp://localhost:2375 without tls

一、设置docker

1、设置暴露2375端口不使用安全传输层协议

Expose daemon on tcp://localhost:2375 without TLS

 2、设置配置文件暴露2375端口

  1. "hosts": [
  2. "tcp://0.0.0.0:2375"
  3. ]

3、重启Docker 

 

二、设置防火墙

使用管理员打开powershell,执行下边命令

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
  1. {
  2. "Platform": {
  3. "Name": "Docker Desktop 4.17.0 (99724)"
  4. },
  5. "Components": [
  6. {
  7. "Name": "Engine",
  8. "Version": "20.10.23",
  9. "Details": {
  10. "ApiVersion": "1.41",
  11. "Arch": "amd64",
  12. "BuildTime": "2023-01-19T17:32:04.000000000+00:00",
  13. "Experimental": "false",
  14. "GitCommit": "6051f14",
  15. "GoVersion": "go1.18.10",
  16. "KernelVersion": "5.15.90.1-microsoft-standard-WSL2",
  17. "MinAPIVersion": "1.12",
  18. "Os": "linux"
  19. }
  20. },
  21. {
  22. "Name": "containerd",
  23. "Version": "1.6.18",
  24. "Details": {
  25. "GitCommit": "2456e983eb9e37e47538f59ea18f2043c9a73640"
  26. }
  27. },
  28. {
  29. "Name": "runc",
  30. "Version": "1.1.4",
  31. "Details": {
  32. "GitCommit": "v1.1.4-0-g5fd4c4d"
  33. }
  34. },
  35. {
  36. "Name": "docker-init",
  37. "Version": "0.19.0",
  38. "Details": {
  39. "GitCommit": "de40ad0"
  40. }
  41. }
  42. ],
  43. "Version": "20.10.23",
  44. "ApiVersion": "1.41",
  45. "MinAPIVersion": "1.12",
  46. "GitCommit": "6051f14",
  47. "GoVersion": "go1.18.10",
  48. "Os": "linux",
  49. "Arch": "amd64",
  50. "KernelVersion": "5.15.90.1-microsoft-standard-WSL2",
  51. "BuildTime": "2023-01-19T17:32:04.000000000+00:00"
  52. }

 

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/302311
推荐阅读
相关标签
  

闽ICP备14008679号