Skip to content

Conversation

@clintoncwolfe
Copy link
Contributor

@clintoncwolfe clintoncwolfe commented Mar 30, 2021

Description

Supports Docker for Windows, by:

  • Making the docker URL an option, and defaulting it to be the TCP port 2375 on Windows
  • Updating the run_command_via_connection method to use cmd.exe when on Windows, rather than always using /bin/sh

Caveats:

  • For Docker Desktop for Windows, you must make a special setting to enable TCP connections on port 2375. I could not get the default named pipe connection to work.
  • Initial Windows detection is crude, by attempting to use /bin/sh and falling back to cmd.exe if a Windows-style error message is detected.
  • If using Windows containers, you must have PowerShell installed in the container, and if not available as powershell.exe, you must pass the name of the executable (likely pwsh) using --shell-command

Tested using the mcr.microsoft.com/powershell:lts-nanoserver-1809 image and the mcr.microsoft.com/windows/servercore:ltsc2019 image.

Related Issue

Fixes #672

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New content (non-breaking change)
  • Breaking change (a content change which would break existing functionality or processes)

Checklist:

  • I have read the CONTRIBUTING document.
… Linux containers if docker socket is exposed via TCP Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
…ction Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment