|
How to Keep the Docker Engine Windows Service Running 24/7 with Service Protector |
Automatically restart Docker Engine if it's accidentally shut down, its TCP/IP port is closed or it stops for any reason.
Ensure that your containers are always operational.
The Docker platform
enables developers to deliver software in independent packages called containers.
Docker's server component — named Docker Engine —
is installed as a Windows Service. It's set to start automatically whenever your computer boots:
To monitor Docker Engine with Service Protector and automatically restart it if it fails:
-
Download and
install
Service Protector, if necessary.
-
Start Service Protector.
-
Select Protector > Add to open the Add Protector window:
-
On the General tab, in the Service to protect field, select Docker Engine:
-
If you find that Docker Engine occasionally stops responding to TCP/IP requests, you should have Service Protector restart the service whenever
Docker loses its connection. Let's set up a "sanity check" to do that.
-
First, find the IP address and port where the Docker Engine executable (dockerd.exe) is listening.
If you don't know that information, we recommend using Microsoft's free
TCPView application to find it.
TCPView enumerates all TCP/IP endpoints on your computer.
Here you can see that Docker is listening on port 53 at IP address 172.19.128.1 on our server:
Save that information; we'll use it in an upcoming step.
-
Back in Service Protector, switch to the Monitor tab.
Check the Whenever it fails a periodic sanity check box and click the Set button:
-
In the Add Sanity Check window, select the Check that a network server is accepting connections
option and click Next to proceed:
-
Enter the IP address and port number where Docker is listening:
Click Next to continue.
-
Specify how often Service Protector should check Docker. Every 30 minutes works for us:
After you're done, click Next to move on.
-
And finally, confirm your settings:
If everything looks good, click Add
to record your new sanity check and bounce back to the Monitor tab.
-
We're done configuring Docker Engine so click the Save button.
In a few seconds, a new entry named Docker Engine will appear in the main window.
The green shield means that Service Protector is already actively monitoring the Docker Engine Windows Service to detect failures:
-
That's it! Next time your computer boots, Docker Engine will start automatically and
Service Protector will babysit the service to promptly restart it if it stops for any reason.
We encourage you to edit your Docker Engine entry in Service Protector and browse through the many other settings that may be appropriate for your environment.
For example, send an email if the service fails, set a high-watermark for CPU or memory usage, and much more.
Trouble protecting the Docker Engine Windows Service?
|
Peace of mind for your important Windows Services!
|
|
|
Step-by-step guides for 70+ Services
|