도커 호스트에 연결하세요!

도커 호스트에 연결하세요!

Docker 호스트 URI에 연결하는 방법을 아는 사람이 있습니까? Docker 호스트에서 작업을 실행하려면 Jenkins를 설정해야 합니까? 도커 호스트 정보입니다. 이것은 우분투 기반 머신입니다.

root@node1:~# netstat -tulnp | grep LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1263/sshd
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      3526/0
tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN      3793/1
tcp6       0      0 :::22                   :::*                    LISTEN      1263/sshd
tcp6       0      0 ::1:6010                :::*                    LISTEN      3526/0
tcp6       0      0 ::1:6011                :::*                    LISTEN      3793/1
root@node1:~#
root@node1:~#
root@node1:~# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-12-14 06:44:46 UTC; 1 day 2h ago
     Docs: https://docs.docker.com
 Main PID: 1249 (dockerd)
    Tasks: 17
   Memory: 69.5M
      CPU: 2min 233ms
   CGroup: /system.slice/docker.service
           ├─1249 /usr/bin/dockerd -H fd://
           └─1401 containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libco

Dec 14 06:44:46 node1 dockerd[1249]: time="2017-12-14T06:44:46.551798058Z" level=info msg="Daemon has completed initialization"
Dec 14 06:44:46 node1 dockerd[1249]: time="2017-12-14T06:44:46.551973729Z" level=info msg="Docker daemon" commit=092cba3 graphdriver=aufs version=1.13.1
Dec 14 06:44:46 node1 systemd[1]: Started Docker Application Container Engine.
Dec 14 06:44:46 node1 dockerd[1249]: time="2017-12-14T06:44:46.580061946Z" level=info msg="API listen on /var/run/docker.sock"
Dec 15 06:41:09 node1 dockerd[1249]: time="2017-12-15T06:41:09.897610342Z" level=warning msg="failed to retrieve runc version: unknown output format: runc version sp
Dec 15 06:41:09 node1 dockerd[1249]: time="2017-12-15T06:41:09.900105358Z" level=warning msg="failed to retrieve docker-init version: unknown output format: tini ver
Dec 15 08:56:46 node1 dockerd[1249]: time="2017-12-15T08:56:46.836355744Z" level=warning msg="failed to retrieve runc version: unknown output format: runc version sp
Dec 15 08:56:46 node1 dockerd[1249]: time="2017-12-15T08:56:46.838301865Z" level=warning msg="failed to retrieve docker-init version: unknown output format: tini ver
Dec 15 09:06:19 node1 dockerd[1249]: time="2017-12-15T09:06:19.272709345Z" level=warning msg="failed to retrieve runc version: unknown output format: runc version sp
Dec 15 09:06:19 node1 dockerd[1249]: time="2017-12-15T09:06:19.274916674Z" level=warning msg="failed to retrieve docker-init version: unknown output format: tini ver

답변1

netstat포트 2375 또는 2376 누락

https://docs.docker.com/engine/installation/linux/linux-postinstall/#allow-access-to-the-remote-api-through-a-firewall

편집하다/lib/systemd/system/docker.service

ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375

그 다음에/etc/default/docker

DOCKER_OPTS="-H tcp://0.0.0.0:2375"

그리고 다시 시작하세요.

원천:https://forums.docker.com/t/cannot-connect-to-the-docker-daemon-is-the-docker-daemon-running-on-this-host/8925/17

관련 정보