Skip to content

Restart Policies on Windows Containers not working on server reboot #27544

@mpwagne

Description

@mpwagne

If I create a windows container with a restart policy of always...
Example:
docker run --restart=always -d -e environment=local --name test_restart mycompany/myimage

then, I would expect this container to always start even if the host gets rebooted.
Results:

  • If I stop the Docker service and then start it, the container set to always restarts fine.
  • If I reboot the Server, the container does not restart. The daemon is started and functional but the container does not restart.
  • If I restart the Docker service after the Server has rebooted then the container starts up fine.

HINT:
If I change the Docker service Startup Type from 'Automatic' to 'Automatic (Delayed Start)', then the container does startup properly after a Server reboot. Though it takes a long, long time to get the daemon started in this mode.

It would seem that some resource (network?) that the Docker service needs when it starts in Automatic mode is not ready at that point in time.

I suggest someone might want to look at adding the proper dependency to the Docker service registration so the startup will not happen until the required dependency is up.


Docker version:
Client:
Version: 1.12.2-rc1
API version: 1.24
Go version: go1.6.3
Git commit: 45bed2c
Built: Tue Sep 27 23:38:15 2016
OS/Arch: windows/amd64
Experimental: true

Server:
Version: 1.12.2-cs2-ws-beta
API version: 1.25
Go version: go1.7.1
Git commit: 050b611
Built: Tue Oct 11 02:35:40 2016
OS/Arch: windows/amd64

Docker info:
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 78
Server Version: 1.12.2-cs2-ws-beta
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: nat null overlay
Swarm: inactive
Security Options:
Kernel Version: 10.0 14393 (14393.321.amd64fre.rs1_release_inmarket.161004-2338)
Operating System: Windows Server 2016 Standard
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 3.999 GiB
Name: TST-SERVERDOCK2
ID: QFVZ:JA27:2AIK:37XT:EIVT:5IHQ:2KHC:SSZM:NE6C:I766:LAHT:A6N6
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
127.0.0.0/8

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions