for-aws icon indicating copy to clipboard operation
for-aws copied to clipboard

How can I restart the docker service?

Open AdrianLoer opened this issue 7 years ago • 7 comments

I have tried now for a few hours to set docker on worker nodes to accept my insecure localhost repository.

To do this I have to restart the docker service/daemon. How do I do that here? What exactly is moby linux?

AdrianLoer avatar Apr 20 '17 00:04 AdrianLoer

right now, there isn't a good way to restart the docker daemon. If you do it, it will most likely cause the node to be considered down by the auto scaling group, and terminated, and replaced by a new node.

We are working on making this easier in future versions.

Moby is a custom linux OS based on LinuxKit: https://github.com/linuxkit/linuxkit

kencochrane avatar Apr 25 '17 18:04 kencochrane

+1.. has this been fixed? Need to be able to restart my docker daemon....

You say "there isn't a good way to restart it".. well.. is there a way at all? I don't care if it results in the node being classified as down, I just want to get it done.

OmpahDev avatar Oct 10 '17 14:10 OmpahDev

Do we have a solution for this yet please?

shazChaudhry avatar Mar 24 '18 23:03 shazChaudhry

@shazChaudhry it's a bit more complicated than that - When you restart the engine, there's also a very high chance you'll trigger an instance health-check failure.

FrenchBen avatar Mar 26 '18 20:03 FrenchBen

OK, thanks @FrenchBen, I understand. Buy does that mean I can not use Docekr4AWS if I wanted to use Nexus3 as an insecure docker registry as I can not configure /etc/docker/daemon.json and then restart daemon?

Would you say that Docker4AWS is not fit for purpose in this very narrow use-case?

shazChaudhry avatar Mar 26 '18 22:03 shazChaudhry

@shazChaudhry for that particular use-case, you don't need to restart the daemon, you just need to send a SIGHUP to the dockerd process (something like docker run --pid=host --rm alpine killall -HUP dockerd) after you've modified the daemon.json.

See also https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file and especially the "CONFIGURATION RELOAD BEHAVIOR" sub-section.

Another option would be to modify the user data template in the cloudformation script to set up daemon.json as you wish at boot time.

hairyhenderson avatar Mar 26 '18 23:03 hairyhenderson

I've seen several issues mention:

We are working on making this easier in future versions.

with regard to getting access to the actual host machine, dockerd service, etc. Is there anywhere I can track progress on this?

dustinschultz avatar Jun 25 '18 15:06 dustinschultz