Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

281
Views
How to start docker daemon automatically with custom arguments in Ubuntu?

I need to start docker daemon with some command line arguments in Ubuntu, and when doing so manually, the following command works fine:

$ dockerd -H fd:// -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock

The above command makes it possible for me to integrate docker with PhpStorm's docker plugin, and configure containers from there. Docker daemon starts listening to TCP port 2375 that is used by PhpStorm in my case.

I need to start docker daemon automatically with the same parameters, and it seems that there is a lot of controversial information about it. I tried many different solutions, including changing /etc/default/docker or /etc/systemd/system/docker.service.d/docker.conf and editing DOCKER_OPTS parameter there.

How can I run docker daemon with the above command line arguments automatically in Ubuntu 16.04?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Among other solutions that didn't work, here is one that did work. It includes changing the docker.service definition:

# edit the following file
# /lib/systemd/system/docker.service
# ...
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock
# ...

After changing that file, run systemctl daemon-reload to apply the changes made to docker.service file, followed by service docker restart.

Another solution does not require changes to docker.service file, which can be later replaced after upgrading docker package, breaking the configuration. It requires creating or editing of /etc/docker/daemon.json file:

{
  "hosts": [
    "fd://",
    "unix:///var/run/docker.sock",
    "tcp://127.0.0.1:2375"
  ]
}

Restarting docker service after these changes are made also makes docker daemon listen to TCP connections on port 2375 or connections using Unix socket.

Note that the above solutions cannot be used together: only one of them should be used to prevent conflicts.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!