Getting "Unknown URL scheme" error if docker is running on alternative protocol
artisticcheese opened this issue · 2 comments
Output of ipmo Docker; (module Docker).Version.ToString()
(from a powershell process):
0.1.0.111
Steps to reproduce the issue:
1.
If dockerd launched with "-H:2375" then using powershell module to interact with it fails. Environment variable is setup to redirect communication to localhost:2375 and native "Docker.exe" commands work as you can see below
What actually happened?:
PS C:\sf> $env:DOCKER_HOST = "localhost:2375"
PS C:\sf> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
11e4b0d0e309 microsoft/iis:latest "C:\\ServiceMonitor..." 4 minutes ago Up 4 minutes
sf-0-a29d18f3-0d2e-4b7e-9b6e-4007cf516227
PS C:\sf> get-containerimage
get-containerimage : Unknown URL scheme localhost
At line:1 char:1
+ get-containerimage
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ContainerImage], Exception
+ FullyQualifiedErrorId : Docker Client Exception,Docker.PowerShell.Cmdlets.GetContainerImage
What did you expect to happen?:
Supposed to work the same way "docker.exe" works
Additional information:
This is a bug. The environment variable will work if the address is more qualified, ie $env:DOCKER_HOST = "tcp://localhost:2375"
, but to match docker behavior we should have some logic that adds the right additional info if the address is not for named pipe and does not contain "tcp://".
Dead module