Created
August 14, 2018 09:44
-
-
Save leonpw/a4795da8499755b4d7e0d7d0a4f3fa57 to your computer and use it in GitHub Desktop.
Allow run docker from non-admin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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