DOCKER_HOST needs to be setup to access docker daemon from non-root in devstack setup

Bug #1618698 reported by janonymous
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kuryr-libnetwork
Fix Released
Undecided
janonymous

Bug Description

=========================
DevStack Component Timing
=========================
Total runtime 439

run_process 64
test_with_retry 1
apt-get-update 14
pip_install 66
restart_apache_server 9
wait_for_service 8
apt-get 5
=========================

This is your host IP address: 10.0.2.15
This is your host IPv6 address: ::1
Horizon is now available at http://10.0.2.15/dashboard
Keystone is serving at http://10.0.2.15/identity/
The default users are: admin and demo
The password: pass
vagrant@devstack:~/devstack$ ps -efa | grep docker
vagrant 2482 24308 0 05:07 pts/26 00:00:00 grep docker
root 25893 25868 0 05:00 pts/6 00:00:00 sudo /usr/bin/docker daemon -H tcp://0.0.0.0:2375 --cluster-store etcd://localhost:4001
root 25896 25893 0 05:00 pts/6 00:00:00 dockerd -H tcp://0.0.0.0:2375 --cluster-store etcd://localhost:4001
root 25939 25896 0 05:00 ? 00:00:00 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shim --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --runtime docker-runc
vagrant@devstack:~/devstack$ sudo docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
vagrant@devstack:~/devstack$ docker ps
Error response from daemon: {
  "Err": "404: Not Found"
}
vagrant@devstack:~/devstack$

After Setting DOCKER_HOST env variable

vagrant@devstack:~/devstack$ export DOCKER_HOST=tcp://0.0.0.0:2375
vagrant@devstack:~/devstack$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Additional Info 2375 is available for tcp6... :

vagrant@devstack:~/devstack$ sudo netstat -anlpto | grep "docker"
tcp 0 0 127.0.0.1:35751 127.0.0.1:4001 ESTABLISHED 25896/dockerd keepalive (17.29/0/0)
tcp 0 0 127.0.0.1:35750 127.0.0.1:4001 ESTABLISHED 25896/dockerd keepalive (19.59/0/0)
tcp6 0 0 :::2375 :::* LISTEN 25896/dockerd off (0.00/0/0)
vagrant@devstack:~/devstack$ sudo netstat -anlpto | grep "kuryr"
vagrant@devstack:~/devstack$ sudo ps -eaf | grep "kuryr"
root 1790 1760 0 05:02 pts/24 00:00:00 sudo PYTHONPATH=:/opt/stack/kuryr SERVICE_USER=admin SERVICE_PASSWORD=pass SERVICE_TENANT_NAME=admin SERVICE_TOKEN=pass IDENTITY_URL=http://127.0.0.1:5000/v2.0 python /opt/stack/kuryr-libnetwork/scripts/run_server.py --config-file /etc/kuryr/kuryr.conf
root 1792 1790 0 05:02 pts/24 00:00:00 python /opt/stack/kuryr-libnetwork/scripts/run_server.py --config-file /etc/kuryr/kuryr.conf
vagrant 4050 24308 0 05:17 pts/26 00:00:00 grep kuryr
vagrant@devstack:~/devstack$ sudo netstat -anlp | grep 23750
tcp 0 0 127.0.0.1:23750 0.0.0.0:* LISTEN 1792/python

janonymous (janonymous)
Changed in kuryr-libnetwork:
assignee: nobody → janonymous (janonymous)
Revision history for this message
janonymous (janonymous) wrote :
Download full text (4.1 KiB)

One more observation that

***When docker is run through tcp://0.0.0.0:2375 ***
--------------------------------------------------------------------------------------------------
vagrant@devstack:~/devstack$ sudo netstat -anlpto | grep "docker"
tcp 0 0 127.0.0.1:36101 127.0.0.1:4001 ESTABLISHED 7268/dockerd keepalive (12.90/0/0)
tcp 0 0 127.0.0.1:36100 127.0.0.1:4001 ESTABLISHED 7268/dockerd keepalive (12.90/0/0)
tcp6 0 0 :::2375 :::* LISTEN 7268/dockerd off (0.00/0/0)
--------------------------------------------------------------------------------------------------

vagrant@devstack:~/devstack$ sudo /usr/bin/docker daemon -H tcp://0.0.0.0:2375 --cluster-store etcd://localhost:4001 & echo $! >/opt/stack/status/stack/docker-engine.pid; fg || echo "docker-engine failed to start" | tee "/opt/stack/status/stack/docker-engine.failure"
[1] 7267
sudo /usr/bin/docker daemon -H tcp://0.0.0.0:2375 --cluster-store etcd://localhost:4001
WARN[0000] [!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting -tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]
INFO[0000] libcontainerd: new containerd process, pid: 7276
WARN[0000] containerd: low RLIMIT_NOFILE changing to max current=1024 max=4096
INFO[0001] [graphdriver] using prior storage driver "aufs"
INFO[0001] Graph migration to content-addressability took 0.00 seconds
WARN[0001] Your kernel does not support swap memory limit.
WARN[0001] mountpoint for pids not found
INFO[0001] Loading containers: start.
INFO[0001] Firewalld running: false
INFO[0001] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address

INFO[0001] Loading containers: done.
INFO[0001] Daemon has completed initialization
INFO[0001] Docker daemon commit=23cf638 graphdriver=aufs version=1.12.1
INFO[0001] API listen on [::]:2375

***When docker is run through tcp://127.0.0.1:2375 ***
----------------------------------------------------------------------------------------------------
vagrant@devstack:~/devstack$ sudo netstat -anlpto | grep "docker"
tcp 0 0 127.0.0.1:2375 0.0.0.0:* LISTEN 5435/dockerd off (0.00/0/0)
tcp 0 0 127.0.0.1:36083 127.0.0.1:4001 ESTABLISHED 5435/dockerd keepalive (13.90/0/0)
tcp 0 0 127.0.0.1:36084 127.0.0.1:4001 ESTABLISHED 5435/dockerd keepalive (13.13/0/0)
----------------------------------------------------------------------------------------------------

vagrant@devstack:~/devstack$ sudo /usr/bin/docker daemon -H tcp://127.0.0.1:2375 --cluster-store etcd://localhost:4001 & echo $! >/opt/stack/status/stack/docker-engine.pid; fg || echo "docker-engine failed to start" | tee "/opt/stack/status/stack/docker-engine.failure"
[1] 5434
sudo /usr/bin/docker daemon -H tcp://127.0.0.1:2375 --cluster-store etcd://localhost:4001
WARN[0000] [!] DON'T BIND ON ANY IP ADDRESS WITHOUT se...

Read more...

Revision history for this message
janonymous (janonymous) wrote :

Granting permissions to access the socket files solves the issue to explicitly set docker_host
https://review.openstack.org/#/c/370598/

Changed in kuryr-libnetwork:
status: New → Fix Committed
janonymous (janonymous)
Changed in kuryr-libnetwork:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.