Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tfenster/dockeraccesshelper
PS module that allows access to the Docker engine for any user
https://github.com/tfenster/dockeraccesshelper
Last synced: 9 days ago
JSON representation
PS module that allows access to the Docker engine for any user
- Host: GitHub
- URL: https://github.com/tfenster/dockeraccesshelper
- Owner: tfenster
- License: mit
- Created: 2018-12-18T09:43:20.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-20T20:01:21.000Z (over 2 years ago)
- Last Synced: 2024-05-28T02:22:35.768Z (7 months ago)
- Language: PowerShell
- Homepage: https://www.axians-infoma.com/techblog/allow-access-to-the-docker-engine-without-admin-rights-on-windows/
- Size: 13.7 KB
- Stars: 71
- Watchers: 2
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - tfenster/dockeraccesshelper - PS module that allows access to the Docker engine for any user (PowerShell)
README
# dockeraccesshelper
PowerShell module that allows access to the Docker engine. Install it using
```
Install-Module -Name dockeraccesshelper
```After that import it and use it to give access to any user
```
PS C:\Windows\system32> Import-Module dockeraccesshelper
PS C:\Windows\system32> Add-AccountToDockerAccess "CONTOSO\PMILLER"
```For more details see https://www.axians-infoma.com/techblog/allow-access-to-the-docker-engine-without-admin-rights-on-windows/
## Manually runing commands in case Import-Module is not preferred
```
$account="\"
$npipe = "\\.\pipe\docker_engine"
$dInfo = New-Object "System.IO.DirectoryInfo" -ArgumentList $npipe
$dSec = $dInfo.GetAccessControl()
$fullControl =[System.Security.AccessControl.FileSystemRights]::FullControl
$allow =[System.Security.AccessControl.AccessControlType]::Allow
$rule = New-Object "System.Security.AccessControl.FileSystemAccessRule" -ArgumentList $account,$fullControl,$allow
$dSec.AddAccessRule($rule)
$dInfo.SetAccessControl($dSec)
```## If running PowerShell 7 or newer
Newer versions of PowerShell do not support the classes/methods currently used by `dockeraccesshelper`. If you face errors like `Method invocation failed because [System.IO.DirectoryInfo] does not contain a method named 'GetAccessControl'.`, you can work around this by:
- temporarily switch to PowerShell 5.1 (or earlier)
- use PowerShell ISE to execute the manual commands