在Windows Server 2016 TP4上安装Docker

3
我希望在安装有Windows Server 2016的物理机器上安装Docker(使用管理员账户,而不是访客或普通用户账户)。因此,我尝试了这个guideline。但第二个命令失败,并显示以下错误:Command: powershell.exe -NoProfile -ExecutionPolicy Bypass C:\Install-ContainerHost.ps1 -HyperV。
...
Docker is already installed.
Installing ContainerImage provider...
C:\Install-ContainerHost.ps1 : Could not install ContainerImage provider
In Line:1 ...
+ C:\Install-ContainerHost.ps1 -HyperV
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
   + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException, Install-ContainerHost.ps1

我找不到解决方案...有什么想法吗?
编辑/更新: 我重新安装了Windows Server 2016。在运行脚本后,我得到了这个错误:
...
Downloading NSSM...
Extracting NSSM for archive...
Configuring NSSM for Docker service...
Starting Docker...
Waiting for Docker daemon...
An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: Das System kann die angegebene Datei nicht finden.
...
An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: Das System kann die angegebene Datei nicht finden.
C:\Users\Administrator\Install-ContainerHost.ps1 : Docker Daemon did not start successfully within 1 minute.
In Zeile:1 Zeichen:1
+ C:\Users\Administrator\Install-ContainerHost.ps1 -HyperV
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-ContainerHost.ps1

在脚本的以下执行中,我得到了我第一篇帖子中的错误。

你是在管理员提示符下运行的吗?听起来像是无法在某个地方写入一些数据。 - Martin
是的,我是。我正在使用管理员帐户,并显式以管理员身份启动了 shell。 - nast
2个回答

5
我遇到了完全相同的问题,以下是如何和解决它的方法。
如果您在系统上运行Get-PSRepository命令,我看到了警告消息“WARNING: Unable to find module repositories”。在我的Windows 10电脑上运行该命令显示我已经设置了一个存储库。
我运行以下命令来设置相同的存储库。
powershell Register-PSRepository -Name "PSGallery" –SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted

每件事都进展顺利。

我正在使用Windows Server 2016 TP5,但我认为这会解决你的问题。


1
命令“Get-PSRepository”返回一个条目列表:PSGallery。但是,安装策略是不受信任的而不是受信任的。我该如何更改这个设置? - nast
2
@nast 请尝试运行 powershell Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted - Sumit Ramteke

0

针对2021年寻找答案的任何人

我使用以下管理员权限的powershell命令在Windows Server 2016上安装了docker:

  1. Install-Module -Name DockerMsftProvider -Repository PSGallery –Force
  2. Install-Package -Name docker -ProviderName DockerMsftProvider -verbose
  3. get-service docker
  4. start-service docker

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接