Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

Commit

Permalink
Remove path manipulation from docker-windows
Browse files Browse the repository at this point in the history
Adds unnecessary complexity to this job script
  • Loading branch information
Ben Moss committed Dec 10, 2019
1 parent 6beed01 commit 7f7aad7
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions jobs/docker-windows/templates/pre-start.ps1
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
$ErrorActionPreference = "Stop";
trap { $host.SetShouldExit(1) }

$mtx = New-Object System.Threading.Mutex($false, "PathMutex")

if (!$mtx.WaitOne(300000)) {
throw "Could not acquire PATH mutex"
}

$AddedFolder= "C:\var\vcap\packages\docker-windows\docker\"

$OldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path

if (-not $OldPath.Contains($AddedFolder)) {
$NewPath=$OldPath+';'+$AddedFolder
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
}

$mtx.ReleaseMutex()

C:\var\vcap\packages\docker-windows\docker\dockerd --register-service

Start-Service Docker

0 comments on commit 7f7aad7

Please sign in to comment.