Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

284
Visualizações
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?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

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.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda