Skip to content

Instantly share code, notes, and snippets.

@Brad-Christie
Last active July 25, 2019 12:07
Show Gist options
  • Save Brad-Christie/e6c9ea209b113baeb6a87b981157bbfd to your computer and use it in GitHub Desktop.
Save Brad-Christie/e6c9ea209b113baeb6a87b981157bbfd to your computer and use it in GitHub Desktop.
Open with Docker (Right-Click Context Menu)

Open with Docker

Allows you to open a host's directory within a mcr.microsoft.com/windows/servercore:ltsc2019 container mounted as C:\host. Quickly run scripts and other utilities against a virgin Windows Server Core image while still maintaining ability to edit files on the host.

Context Menu Docker Container

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Docker]
@="Open with Docker"
"Icon"="C:\\Program Files\\Docker\\Docker\\resources\\ddvp.ico"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Docker\command]
@="cmd /c docker.exe run -it --rm --volume \"%V:C:\\host\" --workdir \"C:\\host\" --entrypoint \"powershell.exe\" \"mcr.microsoft.com/windows/servercore:ltsc2019\""
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Docker]
@="Open with Docker"
"Icon"="C:\\Program Files\\Docker\\Docker\\resources\\ddvp.ico"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Docker\command]
@="cmd /c docker.exe run -it --rm --volume \"%V:C:\\host\" --workdir \"C:\\host\" --entrypoint \"powershell.exe\" \"mcr.microsoft.com/windows/servercore:ltsc2019\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment