lnstructions for server core containers

  1. Install Docker on machine that has Hyper-V enabled.
    • On Windows 10 and 11 – download and install Docker CE.

    • On Windows Server – run the following commands in elevated PowerShell.

      Install-Module DockerMsftProvider -Force
      Install-Package Docker -ProviderName DockerMsftProvider -Force
  2. Restart the PC.
  3. Verify that Docker is in Windows mode – run command docker info to make sure that OSType: Windows
  4. Verify that Docker is working properly by running command docker run hello-world:nanoserver
  5. Download base images, using the following command schemes:

    • docker pull mcr.microsoft.com/windows/nanoserver:<tag>

    • docker pull mcr.microsoft.com/windows/servercore:<tag>

    The images links may change over time. For <tag>, use one of the available tags listed on the Docker site.

  6. Prepare a folder from where you will create an image. It should contain:
    • Program folder, which contains the file set created by Distribution Wizard (64-bit) after selecting all necessary APIs and modules

      • Inside Program there should be your application and inputs

    • Dockerfile:

      # escape=`
      FROM mcr.microsoft.com/windows/servercore:1903
      RUN powershell md c:\Program
      COPY vcredist_x64.exe c:\
      RUN powershell.exe -Command Start-Process C:\vcredist_x64.exe -ArgumentList '/quiet' -Wait
      COPY Program c:\Program
      CMD C:\Program\yourprogramname.exe
    • Licensing.config file, pointing to OPLA licensing server

    • Vcredist_x64.exe – latest visual C redistributable

  7. Open PowerShell, create a new image by navigating to your folder and running this command (with dot): Docker build -t csdkcore .
  8. After image is created – run it by issuing command: Docker run -it csdkcore