How to make use of NutGet provider and docker platform packages
Valentin Komarovskiy, MBA
Solving complex business problems and alleviating technical pain points to improve efficiency and reduce risks.
The NuGet provider is a package management provider for PowerShell, and it allows you to discover, install, and manage packages from the NuGet repository. It allows you to discover, install, and manage packages (libraries, tools, etc.) in your projects. NuGet is not directly related to Docker but is commonly used in the context of software development to manage dependencies.
Docker is a platform for developing, shipping, and running applications in containers. Containers are lightweight, portable, and provide a consistent environment for applications to run. Docker for PowerShell typically refers to using PowerShell commands or scripts to interact with Docker, manage containers, and perform various tasks related to containerized applications.
PowerShell commands can be used to build Docker images, run containers, manage Docker networks, and more. Docker and PowerShell work together to provide a seamless experience for managing containerized environments.
If you try to install a package that requires NutGet and running a container services you will see the following
PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'
Check if NuGet is Installed: Open PowerShell and run the following command to check if the NuGet provider is already installed:
Get-PackageProvider -ListAvailable
Set TLS to version 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install the NuGet package using command as
Install-PackageProvider -Name NuGet
Install the DockerMsftProvider module in PowerShell. This will be required to manage docker containers via PowerShell
Install-Module -Name DockerMsftProvider
Then run docker package
Install-package -name docker -providername DockerMsftProvider -Verbose -Force
Now install container and prompt for restart
(Install-WindowsFeature Containers).RestartNeeded
Now restart your computer
Testing: Then Test your Docker EE installation by running the hello-world container
docker container run hello-world:nanoserver