Search code examples
dockerwindows-server-2016linux-containers

How to Run Docker Linux Containers on Windows Server 2016 Build 14393


I'm in a situation where:

  • I have no choice of server OS (Windows Server 2016 Build 14393).
  • And no choice of container OS (I need Linux Containers).
  • And I don't need Docker EE (Enterprise), CE (Desktop Edition) will do.

Solution

  • The easiest way to get Linux containers without hacky workarounds is to download Docker Community Edition 2.0.0.3 2019-02-15

    Link: https://download.docker.com/win/stable/31259/Docker%20for%20Windows%20Installer.exe

    Page with all versions: https://docs.docker.com/docker-for-windows/release-notes/

    Simply download/copy the file to the Windows Server 2016 machine and run it.

    It can also run offline for air gapped systems.

    Uncheck the "Use Windows containers" during setup. Unchecked by default.

    You will get a message after installing saying that windows so and so is deprecated. Click OK. enter image description here

    Log out and log back in.

    If you hadn't installed Hyper-V it'll prompt you to do it automatically. Allow it, let it finish and restart. You're good to go now.

    I've tested this by running several Linux containers, it works fine. If I'm missing something do share for the benefit of others. The downside is you cannot update to a later version of Docker.

    Update: Disclaimers:

    • This can help you avoid the hardware limitations and complexities of using LCOW with Docker-EE for Windows.
    • It is more recent than the latest official version of LCOW available.
    • This won't let you run Windows and Linux containers in parallel. You can only run one or the other.
    • This also won't start docker automatically at startup (not until you login). To start docker without login you'll need to add Docker Desktop Executable to Windows Task Scheduler and configure it to run on startup whether user is logged in or not. You'll have to provide an account for it (ideally a service account, or an account with a permanent password)