[#65: [PROXY] Cannot find path 'C:[..]\DockerMsftProvider\DockerDefault_DockerSearchIndex.json' because it does not exist.](https://github.com/OneGet/MicrosoftDockerProvider/issues/65)
As of May 23rd 2023 the backing service for this provider has been shutdown. You can find alternative options at [Windows Container Documentation - Setup Environment](https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=dockerce#windows-server-1). For more information on the deprecation please see the following blog posts: [Updates to the Windows Container Runtime support](https://techcommunity.microsoft.com/t5/containers/updates-to-the-windows-container-runtime-support/ba-p/2788799) [Reminder - Updates to Windows Container Runtime Support](https://techcommunity.microsoft.com/t5/containers/reminder-updates-to-windows-container-runtime-support/ba-p/3620989)
>Get-Package-Name Docker -ProviderName DockerMsftProviderName Version Source ProviderName-----------------------------docker 19.03.5 DockerDefault DockerMsftProvider>Find-Package-Name Docker -ProviderName DockerMsftProviderName Version Source Summary------------------------Docker 20.10.9 DockerDefault Contains docker-ee for use with Windows Server.
>Find-Package-Name docker -ProviderName DockerMsftProvider -Proxy http://squid.tls.renault.fr:911-VerboseVERBOSE: Using the provider 'DockerMsftProvider'for searching packages.VERBOSE: Download size: 0.02MBVERBOSE: Free space on the drive: 199788.78MBVERBOSE: Downloading https://dockermsft.blob.core.windows.net/dockercontainer/DockerMsftIndex.json to C:\Users\Administrator\AppData\Local\Temp\DockerMsftProvider\DockerDefault_DockerSearchIndex.json
VERBOSE: About to downloadVERBOSE: Finished downloadingVERBOSE: Downloaded in0 hours,0 minutes,0 seconds.Name Version Source Summary------------------------Docker 19.03.1 DockerDefault Contains Docker EE for use with Windows Server.
>Install-Package-Name Docker -ProviderName DockerMsftProvider -Update -Force Name Version Source Summary------------------------ Docker 20.10.9 DockerDefault Contains Docker EE for use with Windows Server.>Get-Package-Name Docker -ProviderName DockerMsftProvider Name Version Source ProviderName----------------------------- docker 20.10.9 DockerDefault DockerMsftProvider> docker --version Docker version 20.10.9, build 591094d>Start-Service Docker
# On an online machine, download the zip file.> Invoke-WebRequest -UseBasicParsing -OutFile docker-19.03.3.zip https://download.docker.com/components/engine/windows-server/19.03/docker-19.03.3.zip
# Stop Docker service if eralier version of Docker is already installed>Stop-Service docker# Extract the archive.>Expand-Archive docker-19.03.3.zip -DestinationPath $Env:ProgramFiles -Force# Clean up the zip file.>Remove-Item-Force docker-19.03.3.zip# Install Docker. This requires rebooting.>$null=Install-WindowsFeature containers>Restart-Computer-Force# Add Docker to the path for the current session.> $env:path +=';$env:ProgramFiles\docker'# Optionally, modify PATH to persist across sessions.> $newPath ='$env:ProgramFiles\docker;'+ [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine) [Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine)# Register the Docker daemon as a service.> dockerd --register-service# Start the Docker service.>Start-Service docker# verify> docker pull hello-world:nanoserver> docker images> docker container run hello-world:nanoserver
# inspired from http://man.hubwiz.com/docset/Docker.docset/Contents/Resources/Documents/docs.docker.com/install/windows/docker-ee.html
# On an online machine, download the zip file.Invoke-WebRequest -UseBasicParsing -OutFile docker-18.09.5.zip https://download.docker.com/components/engine/windows-server/18.09/docker-18.09.5.zip
# Stop Docker serviceStop-Service docker# Extract the archive.Expand-Archive docker-18.09.5.zip -DestinationPath $Env:ProgramFiles -Force# Clean up the zip file.Remove-Item-Force docker-18.09.5.zip# Install Docker. This requires rebooting.$null=Install-WindowsFeature containers# Add Docker to the path for the current session.$env:path +=";$env:ProgramFiles\docker"# Optionally, modify PATH to persist across sessions.$newPath ="$env:ProgramFiles\docker;"+[Environment]::GetEnvironmentVariable("PATH",[EnvironmentVariableTarget]::Machine)[Environment]::SetEnvironmentVariable("PATH", $newPath,[EnvironmentVariableTarget]::Machine)# Register the Docker daemon as a service.dockerd --register-service# Start the Docker service.Start-Service docker
>Get-Process dockerdHandles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName--------------------------------------------44928138348453564.31161920 dockerd>Get-NetTCPConnection-LocalPort 2376LocalAddress LocalPort RemoteAddress RemotePort State AppliedSetting---------------------------------------------------------------:: 2376 :: 0 Listen# or>Get-NetTCPConnection-LocalPort 2376-State Listen -ErrorVariable $err -ErrorAction SilentlyContinue>Get-Service DockerStatus Name DisplayName---------------------Running Docker Docker Engine
install a specific version
>Install-Package-Name docker -ProviderName DockerMsftProvider -Force -RequiredVersion 18.09...Name Version Source Summary------------------------Docker 18.09 Docker Contains Docker Engine - Enterprise for use with Windows Server...
> docker info...Docker Root Dir: E:\docker_home...WARNING: API is accessible on http://0.0.0.0:2376 without encryption. Access to the remote API is equivalent to root access on the host. Refer to the 'Docker daemon attack surface' section in the documentation for more information: https://docs.docker.com/go/attack-surface/> docker -H tcp://localhost:2376 imagesREPOSITORY TAG IMAGE ID CREATED SIZEhello-world nanoserver e33d37034c87 33 hours ago 258MB
Windows Server Core and Nanoserver are the most common base images to target. The key difference between these images is that Nanoserver has a significantly smaller API surface. PowerShell, WMI, and the Windows servicing stack are absent from the Nanoserver image.
# On an online machine, download the zip file.Invoke-WebRequest -UseBasicParsing -OutFile docker-19.03.3.zip https://download.docker.com/components/engine/windows-server/19.03/docker-19.03.3.zip
install
# Stop Docker service if eralier version of Docker is already installed>Stop-Service docker# Extract the archive.>Expand-Archive docker-19.03.3.zip -DestinationPath $Env:ProgramFiles -Force# Clean up the zip file.>Remove-Item-Force docker-19.03.3.zip# Install Docker. This requires rebooting.>$null=Install-WindowsFeature containers>Restart-Computer-Force# Add Docker to the path for the current session.> $env:path +=';$env:ProgramFiles\docker'# Optionally, modify PATH to persist across sessions.> $newPath ='$env:ProgramFiles\docker;'+ [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine) [Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine)# Register the Docker daemon as a service.> dockerd --register-service# Start the Docker service.>Start-Service docker
# Sample Dockerfile# Indicates that the windowsservercore image will be used as the base image.FROM mcr.microsoft.com/windows/servercore:ltsc2019# Metadata indicating an image maintainer.LABEL maintainer="jshelton@contoso.com"# Uses dism.exe to install the IIS role.RUN dism.exe /online /enable-feature /all /featurename:iis-webserver /NoRestart# Creates an HTML file and adds content to this file.RUN echo "Hello World - Dockerfile" > c:\inetpub\wwwroot\index.html# Sets a command or process that will run each time a container is run from the new image.CMD [ "cmd" ]
In Server Manager, on the Manage menu, click Add Roles and Features.
On the Before you begin page, verify that your destination server and network environment are prepared for the role and feature you want to install. Click Next.
On the Select installation type page, select Role-based or feature-based installation and then click Next.
On the Select destination server page, select a server from the server pool and then click Next.
On the Select server roles page, select Hyper-V.
To add the tools that you use to create and manage virtual machines, click Add Features. On the Features page, click Next.
On the Create Virtual Switches page, Virtual Machine Migration page, and Default Stores page, select the appropriate options.
On the Confirm installation selections page, select Restart the destination server automatically if required, and then click Install.
When installation is finished, verify that Hyper-V installed correctly. Open the All Servers page in Server Manager and select a server on which you installed Hyper-V. Check the Roles and Features tile on the page for the selected server.
SET DOCKER_CERT_PATH= $null, "User"
SET DOCKER_HOST= $null, "User"
SET DOCKER_MACHINE_NAME= $null, "User"
SET DOCKER_TLS_VERIFY= $null, "User"
SET DOCKER_TOOLBOX_INSTALL_PATH= $null, "User"