How to Configure Docker startup on Ubuntu 18


#1

Hi there, I couldn’t find any directions on how to correctly configure the Docker startup options for Ubuntu 18. I tried changing the startup options in the Getting Started guide according to the other Ubuntu versions, but I think I changed some configurations around and now the docker daemon is faling to start.

Right now I can see my /lib/systemd/system/docker.service file changed the relevant line to ExecStart=/usr/bin/dockerd -H fd:// -D -H tcp://127.0.0.1:2375.

If that’s wrong for Ubuntu 18, I tried changing it back to ExecStart=/usr/bin/docker daemon -H fd:// (what I thought was the default) and still it’s not restarting.

What’s the right way to configure for Ubuntu 18? Can I just change the override.conf files I made and the change I detailed above? I appreciate any help!


#2

Hello,

I have very similar problem two days ago - I’m not sure if is a same problem and my way will help you or not.
But - In my case on Ubuntu 16.04 everything works normally according that configuration :
https://www.shinyproxy.io/getting-started/
and on 18.04 nothing works - error in docker run.

In my case - I installed a docker-ce by apt install… And basic configuration of docker-ce is different on 18.04 then 16.04

Steps to solve a problem:

  1. open /lib/systemd/system/docker.service like

sudo nano /lib/systemd/system/docker.service

and check like looks like

ExecStart=/usr/bin/dockerd -H unix://

  1. if you have that line with unix:// that means your configuration is like my and override a config for docker service will not work as in tutorial.
    Instead override it with unix like that: you can use command

sudo systemctl edit docker.service

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -D -H tcp://127.0.0.1:2375

then reload daemon :

sudo systemctl daemon-reload

stop old service if any:

sudo systemctl stop docker.service

run with new conf:

sudo systemctl start docker.service

DONE
In general you ports and redirection must be a same in basic conf /lib/systemd/system/docker.service and override - that means in both files you should have fd:// or unix:://