Forum Discussion
How to run docker on Windows Server 2022 Preview?
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
- tonyiamsMar 05, 2021Copper 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-PSGalleryApiAvailabilityNuGet provider is required to continuePowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGetprovider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or'C:\Users\Administrator\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider byrunning 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to installand 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 packagehas 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-PackageProvider], Exception+ FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProviderPackageManagement\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.ImportPackageProviderWARNING: 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-PackageProvider], Exception+ FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageProviderInstall-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-ModulePS C:\Users\Administrator
Any ideas what might be wrong?
Thanks,
Tony
- Weijuan Shi DavisMar 17, 2021Iron ContributorTony - I tried again today and was able to run it successfully.
- tonyiamsMar 28, 2021Copper Contributor
I identified the problem. It turns out that our corporate Zscaler security was intercepting certificates, blocking Install-Module from connecting with PSGallery. I reconfigured the VM to use a bridged network instead of a NAT (which Zscaler controls), and I was able to install the docker packages. Everything is working correctly now. Thanks for your help!
Regards,
Tony
- Weijuan Shi DavisMar 16, 2021Iron ContributorTony - I couldn't tell why this failed for you. Can you try spinning out another VM? I didn't have any trouble running the installation scripts either using a VM on Azure directly or downloading the VHDX file and spinning up a local VM.