Date

DockerMsftProvider package installation failed

Issue

Failed to install docker package with error: install-package : Cannot rename because item at ‘C:\Program Files\dummyName’ does not exist.

Symptoms

  • Docker package installation failed with error ” install-package : Cannot rename because item at ‘C:\Program Files\dummyName’ does not exist.
  • Created ‘dummyName’ folder in location ‘ C:\Program Files\’, still the package installation failed with same error

Summary

Started installing Docker Module

[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls" 

Install-Module DockerMsftProvider -Force 

install-package docker -ProviderName DockerMsftProvider -Force

install-package : Cannot rename because item at ‘C:\Program Files\dummyName’ does not exist.

At line:1 char:1

+ install-package docker -ProviderName DockerMsftProvider -Force

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (Microsoft.Power….InstallPackage:InstallPackage) [Install-Package],

   Exception

    + FullyQualifiedErrorId : InvalidOperation

Cause

Work around timing issue between unzip and rename folder

Solution

# Rename the docker folder to become Docker

        $dummyName = 'dummyName'
        $null = Rename-Item -Path $script:pathDockerRoot -NewName $env:ProgramFiles\$dummyName
        while (!(Test-Path $env:ProgramFiles\$dummyName)) 
		{ 
			Start-Sleep 1
			$null = Rename-Item -Path $script:pathDockerRoot -NewName $env:ProgramFiles\$dummyName -ErrorAction Continue -Verbose
		}

        $null = Rename-Item -Path $env:ProgramFiles\$dummyName -NewName $script:pathDockerRoot  

Reference

https://github.com/OneGet/MicrosoftDockerProvider/pull/62/files

AZmachina

Knowledge Shared = Knowledge2

We have created AZmachina blog to share our knowledge on Docker & Container and Kubernetes on Windows Servers with curious and enthusiastic novice learner. We hope that this will help them to take a swim in this vast ocean of Window Containers and Kubernetes

Happy Learning !
Recent Posts
Categories
Archives
Sumeet Kumar

Sumeet Kumar

I am Windows Core Engineer with 7+ years of experience in Windows Hyper-v, Failover Cluster, Windows Storage, Volume Shadow Copy (VSS), Docker & Containers on Windows Servers, Backup & Recovery, VMware vSphere EXSi & vCenter Server

RELATED

Articles

Leave a Reply

Your email address will not be published. Required fields are marked *