Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Docker for Windows #674

Merged
merged 4 commits into from
Apr 7, 2021
Merged

Support Docker for Windows #674

merged 4 commits into from
Apr 7, 2021

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 <[email protected]>
Signed-off-by: Clinton Wolfe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker for Windows support
1 participant