docker-archive / for-aws

92 stars 26 forks source link

How can I restart the docker service? #34

Open AdrianLoer opened 7 years ago

AdrianLoer commented 7 years ago

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?

kencochrane commented 7 years ago

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

OmpahDev commented 6 years ago

+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.

shazChaudhry commented 6 years ago

Do we have a solution for this yet please?

FrenchBen commented 6 years ago

@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.

shazChaudhry commented 6 years ago

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?

hairyhenderson commented 6 years ago

@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.

dustinschultz commented 6 years ago

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?