dijous, 18 de maig del 2017


Docker Remote

Docker Daemon allows to you to access remotelly via API, by default is not active and you have to do a samll configuration. The normal use case is using docker-machine in order to create docker machines, but in enterprise envirotmenst not allways is allowed to install software even less docker software. However the developers may still need to conect to docker daemon to have a test envirotment. Below the stesps to provide a docker daemon a http API conection, enoguth to work with Eclipse or Netbeans

Below is explained the stpes done in Unbutu

First stop the docker service. 

service docker stop

Later change the dockerd parameters. There is the option to create a etc/docker/daemon.json but you still are going to need to change the docker.servie since dockerd is started with fd option. And if you try creating daemon.json with "hosts" options it will give an error asking to you to decide either json or dockerd parameteres.


root@ubuntu:/# vi /lib/systemd/system/docker.service

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

Flush the changes.
systemctl daemon-reload
service docker start

root@ubuntu:/etc/docker# service docker status
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-05-18 01:00:59 CEST; 8s ago
     Docs: https://docs.docker.com
 Main PID: 4117 (dockerd)
    Tasks: 16 (limit: 4915)
   Memory: 30.6M
      CPU: 2.003s
   CGroup: /system.slice/docker.service
           ├─4117 /usr/bin/dockerd -H tcp://0.0.0.0:2375 -H fd://
           └─4121 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/l

to verify that docker is running and giving info curl

-X GET http://127.0.0.1:2375/images/json

Only remain Eclipse, Netbeans is exacly de same. It consists only on connect to the daemon


To look up images and containers there is a nice wizard and list.






Cap comentari:

Publica un comentari a l'entrada