Tuesday, February 21, 2017

Enabling Docker Remote API on Ubuntu 16.04

After I wrote my previous blog, I realized it will be good idea to write instruction to enable Remote API

Following instructions were prepared for Ubuntu 16.04
  • Find out where the docker. service file is located:
  • systemctl show --property=FragmentPath docker
  • Display docker.service configuration using following command.
  • cat /lib/systemd/system/docker.service
  •  Please note we will be modifying ExecStart Variable
  •  
  •  Modify the ExecStart variable using following procedure
  •  Open docker.service file using following command
  •  sudo vim /lib/systemd/system/docker.service
  •  Press Alt I to insert the text.
  • Navigate to the row for ExecStart and add following
  •  ExecStart=/usr/bin/dockerd -H 0.0.0.0:2375 -H fd://
  •  To save Press Esc + wq!
  •  Verify configuration using following command
  •  cat /lib/systemd/system/docker.service
  •  
  •  Now update SystemD and restart Docker by running following 2 commands
  • sudo systemctl daemon-reload
  • sudo systemctl restart docker
  • Verify docker is listening on any IP and the port specified
  • systemctl status docker
  •  Now you should be able to access Docker API remotely i.e. You should be able to add host in Management UI (Portainer – Please refer my previous blog)
  •  
  • Once Host is Added you can view it under Dashboard
  •  




No comments:

Post a Comment