Skip to content

Instantly share code, notes, and snippets.

@leonpw
Created August 14, 2018 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leonpw/a4795da8499755b4d7e0d7d0a4f3fa57 to your computer and use it in GitHub Desktop.
Save leonpw/a4795da8499755b4d7e0d7d0a4f3fa57 to your computer and use it in GitHub Desktop.
Allow run docker from non-admin
# Fix docker security for VSTS-agents
# get access control list of pipe
$PipeAcl = [System.IO.Directory]::GetAccessControl('\\.\pipe\docker_engine')
# creat new access control identifier
$secident = new-object -Typename System.Security.Principal.SecurityIdentifier('S-1-2-0')
# Create new access control with identifier
$PipeAccessRule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule($secident, 'FullControl', 'Allow')
# Add new access control to access control list
$null = $PipeAcl.AddAccessRule($PipeAccessRule)
start-sleep 2
# Set new access control list to pipe
[System.IO.Directory]::SetAccessControl('\\.\pipe\docker_engine', $PipeAcl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment