Jump to content

Restart Docker Container Automatically After Crash?


skiman384

Recommended Posts

Hi Everyone,

 

Been struggling with this over the past couple days, and my Linux isn't so great.  Anyways, I am running homebridge in a docker container, sometimes it crashes, and I would like it to auto restart.  I have found the commands that I think should work, but UnRaid doesn't seem to like them.  Here is the command I am running:

 

Here is the docker info:

849da366d1aa        adair21/homebridge-docker     "/root/run.sh"           4 weeks ago         Exited (137) 23 minutes ago                                                     homebridge

 

 

Command I Run:

docker run -d --name homebridge --restart unless-stopped homebridge

 

Output:

Unable to find image 'homebridge:latest' locally
Pulling repository docker.io/library/homebridge
docker: Error: image library/homebridge:latest not found.
See 'docker run --help'.

 

 

Can anyone help?

 

Thanks!

Link to comment

Thanks!

 

So I think I got it right, I tried what you had above and got the following error:

 

docker: Error response from daemon: Conflict. The name "/homebridge" is already in use by container 849da366d1aaa93389a38953aa7e28138de19b3bfb0ed365cf58622c7dcc1464. You have to remove (or rename) that container to be able to reuse that name..
See 'docker run --help'.

 

 

I then just ran :

docker run -d - --restart unless-stopped adair21/homebridge-docker and got this response:

906851b25122e269673454b6816117281466b9e3cea71c2fb2876239c6e7f520

 

 

Link to comment

The error is because you're trying to reinstall the container using the same name

 

Its going to be easiest if you simply add to the extra parameters of the template

13 hours ago, Squid said:

you can add the --restart unless-stopped (or --restart always) into the extra parameters section of the template

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...