Skip to content

Support Docker for Windows - #674

Merged
clintoncwolfe merged 4 commits into
masterfrom
cw/docker-for-windows
Apr 7, 2021
Merged

clintoncwolfe merged 4 commits into
masterfrom
cw/docker-for-windows

Conversation

@clintoncwolfe

@clintoncwolfe clintoncwolfe commented Mar 30, 2021 •

Copy link
Copy Markdown
Contributor

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker for Windows support

1 participant