Docker: Enable API: Difference between revisions

From wiki.jacobjohns.com
jwiki>jjohns
Created
 
jwiki>jjohns
Line 5: Line 5:
# Edit the docker.service
# Edit the docker.service
#* <code>sudo systemctl edit docker.service</code>
#* <code>sudo systemctl edit docker.service</code>
#* Add: [Service]  ExecStart= ExecStart=/usr/bin/dockerd
#* Add the below above the '''### Lines below this comment will be discarded line''<nowiki/>':
# Create <code>/etc/docker/daemon.json</code>  with the below {    "hosts": ["unix:///var/run/docker.sock", "tcp://<HostIP>:2375"] }
  [Service]   
# Restart docker
  ExecStart=  
#* <code>systemctl restart docker</code>
  ExecStart=/usr/bin/dockerd
#Create <code>/etc/docker/daemon.json</code>  with the below  
  {   
    "hosts": ["unix:///var/run/docker.sock", "tcp://<HostIP>:2375"]  
  }
#Restart docker
#*<code>systemctl restart docker</code>

Revision as of 14:17, 24 June 2023

Enable Docker API

  1. Edit the docker.service
    • sudo systemctl edit docker.service
    • Add the below above the '### Lines below this comment will be discarded line':
 [Service]  
 ExecStart=   
 ExecStart=/usr/bin/dockerd
  1. Create /etc/docker/daemon.json with the below
 {     
   "hosts": ["unix:///var/run/docker.sock", "tcp://<HostIP>:2375"]   
 }
  1. Restart docker
    • systemctl restart docker