Forum Discussion

tonyiams's avatar
tonyiams
Copper Contributor
Mar 04, 2021

How to run docker on Windows Server 2022 Preview?

Hello,

 

I installed Windows Server 2022 Preview Build 20298, and it does not seem to include the docker command. I would like to run "docker build" and "docker run" from PowerShell, but I get the error: "The term 'docker is not recognized...". 

 

Does anyone know how to install the docker command on Windows Server 2022 Preview?

 

Thanks,

 

Tony

7 Replies

  • Tony - thanks for the interest!

    A few steps here:
    1) Set up your environment on that build, following the instructions here:
    https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server

    2) Given it's an Insider build, you may need this step as well:
    https://hub.docker.com/_/microsoft-windows-servercore-insider

    3) Then you can run a command like this to get your Windows Server 2022 Preview container images:
    docker pull mcr.microsoft.com/windows/servercore/insider:10.0.20298.1

    As a reference, these are Docker Hub Windows Server Base OS container image Insider release pages:
    https://hub.docker.com/_/microsoft-windows-servercore-insider
    https://hub.docker.com/_/microsoft-windows-nanoserver-insider

    I am curious what your use cases will be. What features/technologies are you planning to try out?

    Weijuan
    • tonyiams's avatar
      tonyiams
      Copper Contributor

      Weijuan Shi Davis Thanks for the response.

       

      I tried following the instructions here:

      https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server

       

      However, I get an error on the first step (Install-Module -Name DockerMsftProvider -Repository PSGallery -Force):

       

      PS C:\Users\Administrator> Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

      Get-PSGalleryApiAvailability : PowerShell Gallery is currently unavailable.  Please try again later.
      At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1748 char:9
      +         Get-PSGalleryApiAvailability -Repository $Repository
      +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [Get-PSGalleryApiAvailability], InvalidOperationException
          + FullyQualifiedErrorId : PowerShellGalleryUnavailable,Get-PSGalleryApiAvailability
       
       
      NuGet provider is required to continue
      PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
       provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
      'C:\Users\Administrator\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by
       running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install
      and import the NuGet provider now?

      [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):

       

       

      BTW, the next step suggested here, installing "NuGet" fails as well, even though the connectivity to this system is fine:

       

      [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y

      WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
      WARNING: Unable to download the list of available providers. Check your internet connection.
      PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider
      'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package
      has the tags.
      At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7468 char:21
      + ...     $null = PackageManagement\Install-PackageProvider -Name $script:N ...
      +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-Pac
         kageProvider], Exception
          + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackagePro
         vider
       
      PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider name
      'NuGet'. Try 'Get-PackageProvider -ListAvailable' to see if the provider exists on the system.
      At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7474 char:21
      + ...     $null = PackageManagement\Import-PackageProvider -Name $script:Nu ...
      +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidData: (NuGet:String) [Import-PackageProvider], Exception
          + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProv
         ider
       
      WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
      WARNING: Unable to download the list of available providers. Check your internet connection.
      PackageManagement\Get-PackageProvider : Unable to find package provider 'NuGet'. It may not be imported yet. Try
      'Get-PackageProvider -ListAvailable'.
      At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7478 char:30
      + ... tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet ...
      +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackageProvi
         der], Exception
          + FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPacka
         geProvider
       
      Install-Module : NuGet provider is required to interact with NuGet-based repositories. Please ensure that '2.8.5.201'
      or newer version of NuGet provider is installed.
      At line:1 char:1
      + Install-Module PowerShellGet -RequiredVersion 2.2.4 -SkipPublisherChe ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [Install-Module], InvalidOperationException
          + FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Install-Module
       

      PS C:\Users\Administrator

       

       

      Any ideas what might be wrong?

       

      Thanks,

       

      Tony

       

       

  • LubomirH's avatar
    LubomirH
    Brass Contributor
    this guide might help
    https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=Windows-Server

Resources