1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Autostart docker containers in Windows?

Discussion in 'Windows Server, Hyper-V Virtualization' started by IamSpartacus, Apr 15, 2018.

  1. IamSpartacus

    IamSpartacus Well-Known Member

    Joined:
    Mar 14, 2016
    Messages:
    1,322
    Likes Received:
    266
    I'm having trouble finding any good documentation on how to get docker containers to autostart with Windows. Can someone point me towards how to do this?
     
    #1
  2. marcoi

    marcoi Active Member

    Joined:
    Apr 6, 2013
    Messages:
    841
    Likes Received:
    133
    i would probably create a batch file to start the dockers, then put it into windows scheduler with task to run whenever the system boots.
    There might be a better way to do this but the above first thing that came to me.
     
    #2
  3. IamSpartacus

    IamSpartacus Well-Known Member

    Joined:
    Mar 14, 2016
    Messages:
    1,322
    Likes Received:
    266
    The problem is that requires login. I want to get a docker and specific containers to auto start with Windows without user login.
     
    #3
  4. K D

    K D Well-Known Member

    Joined:
    Dec 24, 2016
    Messages:
    1,179
    Likes Received:
    243
    You can have tasks run at startup with Task Scheduler
     
    #4
  5. marcoi

    marcoi Active Member

    Joined:
    Apr 6, 2013
    Messages:
    841
    Likes Received:
    133
    I believe you can with the below option.
    upload_2018-4-16_11-49-31.png
     
    #5
    abq likes this.
  6. IamSpartacus

    IamSpartacus Well-Known Member

    Joined:
    Mar 14, 2016
    Messages:
    1,322
    Likes Received:
    266

    This works with non-local (domain) accounts?
     
    #6
  7. K D

    K D Well-Known Member

    Joined:
    Dec 24, 2016
    Messages:
    1,179
    Likes Received:
    243
    It does.
     
    #7
  8. IamSpartacus

    IamSpartacus Well-Known Member

    Joined:
    Mar 14, 2016
    Messages:
    1,322
    Likes Received:
    266
    Sweet. I'll give this a shot. Thanks!
     
    #8
  9. IamSpartacus

    IamSpartacus Well-Known Member

    Joined:
    Mar 14, 2016
    Messages:
    1,322
    Likes Received:
    266
    Alright, I accomplished this by creating a scheduled task that calls "C:\Program Files\Docker\Docker\Docker for Windows.exe". My container is set to --restart always so it starts with the docker service.
     
    #9
    Last edited: Apr 16, 2018
    K D likes this.
Similar Threads: Autostart docker
Forum Title Date
Windows Server, Hyper-V Virtualization Docker for Windows - Get excited Jun 20, 2016
Windows Server, Hyper-V Virtualization Microsoft Hyper-V Docker Apr 8, 2015

Share This Page