Skip to content

Enable Docker API

Anselmo Battisti edited this page May 4, 2020 · 3 revisions

In Ubuntu Server 20 the docker is installed using snap.

By running: systemctl status snap.docker.dockerd.service I was able to see which was the loaded service file: /etc/systemd/system/snap.docker.dockerd.service

battisti@s1:~$ systemctl status snap.docker.dockerd.service
● snap.docker.dockerd.service - Service for snap application docker.dockerd
     Loaded: loaded (/etc/systemd/system/snap.docker.dockerd.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-05-04 14:50:24 UTC; 22min ago
   Main PID: 2100 (dockerd)
      Tasks: 18 (limit: 2283)
     Memory: 215.2M
     CGroup: /system.slice/snap.docker.dockerd.service
             ├─2100 dockerd -G docker --exec-root=/var/snap/docker/423/run/docker --data-root=/var/snap/docker/common/var-lib-d>
             └─2173 containerd --config /var/snap/docker/423/run/docker/containerd/containerd.toml --log-level 

Just looked inside this file looking for the ExecStart directive. It was there.

So just had to add -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock to that line, so it ended up looking like:

ExecStart=/usr/bin/snap run docker.dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

Rebooted the machine.