Giter VIP home page Giter VIP logo

docker-powershell's Introduction

THIS MODULE HAS BEEN DEPRECATED

Please note that due to low usage this module is no longer being actively maintained. It is recommended to use either the Docker cli (docker.exe) or try Docker.DotNet directly.


PowerShell for Docker

This repo contains a PowerShell module for the Docker Engine. It can be used as an alternative to the Docker command-line interface (docker), or along side it. It can target a Docker daemon running on any operating system that supports Docker, including both Windows and Linux.

Note that this module is still in alpha status and is likely to change rapidly.

Dependencies

Note that there is no dependency on the Docker client.

Currently, the Docker endpoint must support API version 1.24, which is still in development. Practically speaking, this means you will need a development build of Docker. If your Docker endpoint is running on Windows Server Technical Preview 5, that should be new enough.

Installation

See our Releases page for current releases of Docker PowerShell, or you can try the development builds below. Feedback and contributions welcome!

Development Builds

build status

The following information will allow you to install development builds -- do understand that these are early builds and will change (hopefully with your feedback).

The dev builds are updated for every commit to master and are released to https://ci.appveyor.com/nuget/docker-powershell-dev. To install the latest build, in PowerShell 5.0 run:

> Register-PSRepository -Name DockerPS-Dev -SourceLocation https://ci.appveyor.com/nuget/docker-powershell-dev

> Install-Module -Name Docker -Repository DockerPS-Dev -Scope CurrentUser

(Note: if you get an error like "WARNING: MSG:SourceLocationNotValid" try updating your Nu-Get version as explained in this issue comment.)

After this, you can update to new development builds with just:

> Update-Module -Name Docker

Linux and Mac OS X

As of the v6.0.0-alpha.10 release of PowerShell, the instructions listed above for development builds work as expected on Linux.

Need an offline workflow?

From an internet connected machine:

> Save-Module -Name Docker -Path .

Copy the entire folder .\Docker to the destination at: %ProgramFiles%\WindowsPowerShell\Modules

Contributions

We welcome contributions to this project in the form of issues (bugs, suggestions, proposals, etc.) and pull requests.

For pull requests, we do require that you sign the Microsoft Contribution License Agreement. It is a simple process that you only need to complete once.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Compilation

Before Compiling: Git submodules for Docker.DotNet

This project uses Docker.DotNet as a git submodule (git submodule --help to view manual pages for submodule). When first starting a new clone of Docker.Powershell, this requires one-time initializtion of the submodule with git submodule update --init to prepare the directories used by the submodule. When making changes to Docker.PowerShell that use corresponding changes made to Docker.DotNet master branch, use git submodule update --remote to sync the submodule to the latest in master, and include the updated commit id for the submodule in the changes submitted to Docker.Powershell.

Compiling with DotNet CLI

To compile this project, you need the following:

Once these are installed, you can run:

> dotnet restore

> dotnet publish .\src\Docker.PowerShell -o .\src\Docker.PowerShell\bin\Module\Docker -f net46

or for a module targetted at cross-platform PowerShell:

> dotnet restore

> dotnet publish .\src\Docker.PowerShell -o .\src\Docker.PowerShell\bin\Module\Docker -f netstandard1.6

This will produce the PowerShell module at .\src\Docker.PowerShell\bin\Module\Docker in the project folder.

You will only need to run dotnet restore once unless you pull changes that update the project dependencies in project.json.

Updating Help Markdown Files

This codebase includes markdown files corresponding to the help information for each of the cmdlets. This markdown is generated and consumed by the platyPS PowerShell module. You should use the platyPS cmdlets to update and refresh the markdown files to reflect any changes made to the structure or behavior of the cmdlets. Follow the instructions on the platyPS github readme to get the module installed, and then after imported the Docker module with your changes compiled in, run:

> New-MarkdownHelp -Module Docker -OutputFolder .\src\Docker.Powershell\Help -ErrorAction SilentlyContinue

> Update-MarkdownHelp -Path .\src\Docker.PowerShell\Help

This will create new entries for any added parameters in existing cmdlets, as well as new markdown files for any new cmdlets, leaving placeholder text for the descriptions and examples. Please keep the descriptions of any existing or new parameters or cmdlets up-to-date with any changes to the implementation.

Visual Studio Code

If you use Visual Studio Code as your editor, you will find three tasks pre-defined in the top-level directory:

  • restore will perform dotnet restore across the whole project to reload any dependencies.
  • build will perform the dotnet publish command with the arguments listed in the compilation section above.
  • test will launch a new powershell window with the module loaded for manual testing.
  • update-help will use powershell to run the New-MarkdownHelp and Update-MarkdownHelp cmdlets with the arguments necessary to generate any updates to the help markdown files. NOTE: This requires the platyPS module and uses the most recently built local Docker module.

docker-powershell's People

Contributors

aoatkinson avatar brian-young avatar jstarks avatar jterry75 avatar pcgeek86 avatar swernli avatar thecloudtaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-powershell's Issues

Need cross-platform NuGet feed

Due to some limitations in how the PowerShell package gets produced and consumed, we can't host both the Windows and the cross-platform PowerShell module in the same NuGet package. This means that if we want someone to try the cross-platform cmdlets, they are stuck building them directly themselves. Until we figure out the one package to rule them all, we need an interim solution where a separate feed can host the cross-platform module for anyone trying out the cmdlets on the new open source PowerShell.

cannot attach to conatiner in remoting session

Get-Container | Attach-Container

Attach-Container : The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
+ CategoryInfo : NotSpecified: (:) [Enter-ContainerSession], COMException
+ FullyQualifiedErrorId : Docker Client Exception,Docker.PowerShell.Cmdlets.EnterContainerSession

same with Enter-ContainerSession

reproduce:
PS remote to nanoserver VM, run detached container, try to enter with commands above.

when doing the same with docker attach, I get an error that TTY is not supported.

I was told by @PatrickLang in the MSDN Container Docs Repo that it should work with Docker PS

Install-ContainerOSImage got purged with Container module Win10 build 14379

In the latest Win10 build 14379, the inbox Containers module got removed and with it, the Install-ContainerOSImage function. The ContainerImage Package Provider relies on this function to install the base OS image but now it is missing, we cannot install the base image anymore.
I get that we need to switch working with Docker API and this module but now I can't start anymore until Install-ContainerOSImage is replaced or the Package Provider installs the image in another way.

Error messages and guidance messages should be improved.

Right now, all exceptions from Docker.DotNet are just bubbled up to the PowerShell session, leading to some less than clear error messages (eg: Get-Container with no target daemon fails with "An error occurred while sending the request"). Some of these may require updates to Docker.DotNet to throw more specific errors, but in general the friendly error messages (with appropriate guidance) should be generated in the Docker.PowerShell code.

Issue OneGet NuGet provider 2.8.5.207

Hi, we see an issue NuGet/Home#3495 saying something with the new version of the OneGet (PackageManagement) provider 2.8.5.207. I looked your appveyor.yml, it looks like you are using:

WS2012R2+WMF5.1 Preview.
nuget.exe to create a docker.nupkg.
register a package source 'test' to the local folder
use oneget/powershellget to find-module and install-module from your local share.

If the above statement is correct, the nuget provider version should not impact you.
Also if you want PowerShellGet to find or install-module, your docker.nuspec must contain tags, for example, PSModule . Otherwise, there is no way for powershellget to find docker as module.

My recommendation is to update your .nuspec to add tags to include PSModule.

Image incompatibility error for new container does not surface

I know Containers on win10 are still early preview but I wanted to test anyway.
Unfortunately there are currently no Container Images available for Win10.
When trying to create a container with the WindowsServerCore image, Docker run responds with an exception. New-Container does not and leaves an impression it worked correctly.

untitled

Run-ContainerImage fails with -Configuration parameter present

Output of $PSVersionTable (from a powershell process):

Name                           Value                                                                                                                                                                                                                                               
----                           -----                                                                                                                                                                                                                                               
PSVersion                      5.1.14393.206                                                                                                                                                                                                                                       
PSEdition                      Desktop                                                                                                                                                                                                                                             
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                                             
BuildVersion                   10.0.14393.206                                                                                                                                                                                                                                      
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                                     
WSManStackVersion              3.0                                                                                                                                                                                                                                                 
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                                                 
SerializationVersion           1.1.0.1  

Output of ipmo Docker; (module Docker).Version.ToString() (from a powershell process):

PS C:\WINDOWS\system32> (get-module docker).Version

Major  Minor  Build  Revision
-----  -----  -----  --------
0      1      0      111   

Steps to reproduce the issue:
1.

Import-module docker
$config = [Docker.DotNet.Models.Config]::new()
$dict = new-object 'system.collections.generic.dictionary[string,object]' 
$dict.Add("d:\container\content", "c:\inetpub\wwwrooot\content")
$config.Volumes = $dict
Run-ContainerImage -ImageIdOrName "microsoft/iis" -Configuration $config -Detach
Run-ContainerImage : Docker API responded with status code=InternalServerError, response=json: cannot unmarshal string into Go value of type struct {}
At D:\docker\run-MFEcountainer.ps1:13 char:1
+ Run-ContainerImage -ImageIdOrName "microsoft/iis" -Configuration $con ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-ContainerImage], DockerApiException
    + FullyQualifiedErrorId : Docker Client Exception,Docker.PowerShell.Cmdlets.InvokeContainerImage

What actually happened?:
Error

What did you expect to happen?:
Start container

Additional information:

Get-ContainerDetail does not work

PS C:\Users\jostarks\Source\Repos\Docker-PowerShell> Get-ContainerDetails cranky_shaw
Get-ContainerDetails : Error converting value {null} to type 'System.Int64'. Path 'HostConfig.MemorySwappiness', line 1, position 1600.
At line:1 char:1

  • Get-ContainerDetails cranky_shaw
  • - CategoryInfo          : NotSpecified: (:) [Get-ContainerDetails], JsonSerializationException
    - FullyQualifiedErrorId : Newtonsoft.Json.JsonSerializationException,Docker.PowerShell.Cmdlets.GetContainerDetails
    

Start-ContainerProcess missing Args[] paramers

Steps to reproduce the issue:

  1. Start-ContainerProcess -ContainerIdOrName first -Command "powershell (dir c:)"

What actually happened?:
Error being thrown

container 7c4de1fc1a26875e307a094f98d5c510750b30a0c29a013c79f6001a454c3f35 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: {"ApplicationName":"","CommandLine":"\"powershell (dir c:\\)\"","User":"","WorkingDirectory":"C:\\","Environment":{},"EmulateConsole":false,"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}

What did you expect to happen?:
Same as output of
docker exec 7c "powershell.exe" "(dir c:\)"
That is listing of directory on C drive

Additional information:

Copy-ContainerFile doesn't work for directory

Output of $PSVersionTable (from a powershell process):

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14931.1000
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14931.1000
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Output of ipmo Docker; (module Docker).Version.ToString() (from a powershell process):

ipmo Docker; (module Docker).Version.ToString()
0.1.0.100
(paste your output here)

Steps to reproduce the issue:
1.

docker create alpine ash
d2fc2b6997b25d3d4647bdc0435dd1459c37a203a7a9e01f2bd9d8d3192c302a
Copy-ContainerFile -Id d2fc2b6997b25d3d4647bdc0435dd1459c37a203a7a9e01f2bd9d8d3192c302a -Path /lib -Destination .\hestsmed

Copy-ContainerFile : Attempted to read past the end of the stream.
At line:1 char:1
+ Copy-ContainerFile -Id d2fc2b6997b25d3d4647bdc0435dd1459c37a203a7a9e0 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Copy-ContainerFile], EndOfStreamException
    + FullyQualifiedErrorId : Docker Client Exception,Docker.PowerShell.Cmdlets.CopyContainerFile

What actually happened?:

Error

What did you expect to happen?:

File copied

(MacOS) Install failing: Could not compare "6.0.0-alpha" to "5.0". Error...

Output of $PSVersionTable (from a powershell process):

PS /Users/<username>/.local/share/powershell/Modules> $PSVersionTable.PSVersion

Major Minor Patch Label
----- ----- ----- -----
    6     0     0 alpha

Output of ipmo Docker; (module Docker).Version.ToString() (from a powershell process):

(paste your output here)

Steps to reproduce the issue:

  1. Register-PSRepository -Name DockerPS-Dev -SourceLocation https://ci.appveyor.com/nuget/docker-powershell-dev
    2.Install-Module Docker -Repository DockerPS-Dev

What actually happened?:
I am on a MacOS system 10.11.6 and have installed the PowerShell from here: https://github.com/PowerShell/PowerShell

After that I tried installing the docker module, with the complete error:

PS /Users//.local/share/powershell/Modules> Install-Module Docker -Repository DockerPS-Dev

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by
running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'DockerPS-Dev'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
PackageManagement\Install-Package : Could not compare "6.0.0-alpha" to "5.0". Error: "Cannot convert value "5.0" to type "System.Management.Automation.SemanticVersion". Error: "Cannot process argument because the value of argument "version" is not valid. Change the value of the "version" argument and run the operation again."" At /usr/local/microsoft/powershell/6.0.0-alpha.9/Modules/PowerShellGet/PSModule.psm1:1706 char:21oooooooooooooooooooooooooooooooooooo] + ... $null = PackageManagement\Install-Package @PSBoundParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : ComparisonFailure,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

What did you expect to happen?:
Successful Installation

Additional information:

Importing the module results in a names warning

The current set of cmdlet names causes an error when importing the module due to name verification. While this can be suppressed by using the DisableNameChecking flag in Import-Module, the module really should adhere to valid PowerShell verbs. Alternates can be configured via aliases, which are not verified by Import-Module.

Get-ContainerDetails violates the singular noun rule

All PowerShell commands should have a singular noun.

Details is plural.

Therefore, Get-ContainerDetails is in violation of this rule. To correct this, rename Get-ContainerDetails as Get-ContainerDetail, Get-ContainerInfo, or something similar.

If you're worried about backward compatibility with the Get-ContainerDetails name already, create a Get-ContainerDetails alias in the binary module itself or in a script module file and associate that alias with the new command name. I think this is early enough that you shouldn't be too worried about backward compatibility for this command, especially since another issue is logged against it saying it is not working.

Conflict: Save-ContainerImage command with ContainerImage Package Provider

Output of $PSVersionTable (from a powershell process):

Name                           Value
----                           -----
PSVersion                      5.1.14393.206
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.206
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Output of ipmo Docker; (module Docker).Version.ToString() (from a powershell process):

Name   Version
----   -------
Docker 0.1.0.95
Docker 0.0.0.70
Docker 0.0.0.58

Steps to reproduce the issue:

  1. Launch an administrative PowerShell Desktop Edition prompt
  2. Install the Docker PowerShell module, per README.md
  3. Run command: Install-PackageProvider ContainerImage -Force from this article

What actually happened?:

PS C:\windows\system32> Install-PackageProvider ContainerImage -Force
Install-PackageProvider : A command with name 'Save-ContainerImage' is already available on this system. This module
'ContainerImage' may override the existing commands. If you still want to install this module 'ContainerImage', use
-AllowClobber parameter.
At line:1 char:1
+ Install-PackageProvider ContainerImage -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-Pa
   ckageProvider], Exception
    + FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.Pack
   ageManagement.Cmdlets.InstallPackageProvider

What did you expect to happen?:

The ContainerImage Package Provider should install successfully, side by side with the Docker PowerShell module.

Additional information:

Cheers,
Trevor Sullivan
Docker Captain
Microsoft MVP: Cloud & Data Center Management
https://trevorsullivan.net
https://twitter.com/pcgeek86

HostAddress parameter only present in default parameter set

For some reason the HostAddress parameter is only present on the default parameter set... I think this was a hold-over from an older design where the objects would track their host address, but that is no longer the case. HostAddress should be present on every parameter set. Updating this will also require an update to the help content for all cmdlets.

does not work with nanoserver?

Get-Container gives me this error:

Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral,
PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified.

what I tried:

install-Package Newtonsoft.Json -> same error

Having $null object in string[] passed to -Command parameter produces error

Steps to reproduce the issue:
1.
New-Container -Isolation HyperV -Name "first" -Command @("dsadasd", "") -ImageIdOrName "microsoft/iis"
2.
3.

What actually happened?:
Getting error

New-Container : Cannot validate argument on parameter 'Command'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At line:1 char:56
+ ... ner -Isolation HyperV -Name "first" -Command @("dsadasd", "") -ImageI ...
+                                                  ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [New-Container], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Docker.PowerShell.Cmdlets.NewContainer

What did you expect to happen?:
Supposed to take empty values (like if you used Get-Content to pull contents of text file with empty lines)

Additional information:
Also what is supposed to be fed to -Command? Is it commands from docker file or it can be plainly written powershell script?

Get Docker Module issue: Unable to register PS Repository on Debian distro

Output of $PSVersionTable (from a powershell process):

Name                           Value                                           
----                           -----                                           
PSVersion                      6.0.0-alpha                                     
PSEdition                      Core                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                         
BuildVersion                   3.0.0.0                                         
GitCommitId                    v6.0.0-alpha.11                                 
CLRVersion                                                                     
WSManStackVersion              3.0                                             
PSRemotingProtocolVersion      2.3                                             
SerializationVersion           1.1.0.1                                         

Output of ipmo Docker; (module Docker).Version.ToString() (from a powershell process):

Wasn't able to Import Docker module yet due to Register-PSRespository cmdlet failure

Steps to reproduce the issue:

  1. Go to https://github.com/Microsoft/Docker-PowerShell
    2.Follow the instruction to get Docker module
    3.Get error message below when trying to run Register-PSRepository cmdlet
    Register-PSRepository : The specified Uri
    'https://ci.appveyor.com/nuget/docker-powershell-dev' for parameter
    'SourceLocation' is an invalid Web Uri. Please ensure that it meets the Web
    Uri requirements.
    At line:1 char:1
  • Register-PSRepository -Name DockerPS-Dev -SourceLocation https://ci.a ...
  •   + CategoryInfo          : InvalidArgument: (https://ci.appv...-powershell- 
     dev:String) [Register-PSRepository], ArgumentException
      + FullyQualifiedErrorId : InvalidWebUri,Register-PSRepository
    
    
    
    

What actually happened?:
Register-PSRepository : The specified Uri
'https://ci.appveyor.com/nuget/docker-powershell-dev' for parameter
'SourceLocation' is an invalid Web Uri. Please ensure that it meets the Web
Uri requirements.
At line:1 char:1

  • Register-PSRepository -Name DockerPS-Dev -SourceLocation https://ci.a ...
  •   + CategoryInfo          : InvalidArgument: (https://ci.appv...-powershell- 
     dev:String) [Register-PSRepository], ArgumentException
      + FullyQualifiedErrorId : InvalidWebUri,Register-PSRepository
    
    

What did you expect to happen?:
Register should be successful

Additional information:
The issue occurred on Debian distro
Linux kali 4.6.0-kali1-amd64 #1 SMP Debian 4.6.4-1kali1 (2016-07-21) x86_64 GNU/Linux

Interactivity to container doesn't work for named pipe connections

When using any of the cmdlets that provide an interactive session with the container (Enter-ContainerSession, Run-ContainerImage, Exec-Container), the resulting session will work fine when connected to the daemon by tcp or unix socket, but fails to accept input and hangs when connected via named pipe. Still not sure why, investigation ongoing...

Build-ContainerImage doesn't seem to work

I put a Dockerfile in the current directory and tried Build-ContainerImage.

> Build-ContainerImage
Build-ContainerImage : Docker API responded with status code=InternalServerError, response=
At line:1 char:1
+ Build-ContainerImage
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-ContainerImage], DockerApiException
    + FullyQualifiedErrorId : Docker.DotNet.DockerApiException,Docker.PowerShell.Cmdlets.NewContainerImage

Need cmdlet to generate Docker.DotNet.Models.AuthConfig object

Currently I need to instantiate an AuthConfig object myself and then specify username and password.

$DockerAuth = [Docker.DotNet.Models.AuthConfig]::new()
$DockerAuth.Username = 'bgelens'
$DockerAuth.Password = 'mypassword'

Normally in the PowerShell world, there would be a wrapper cmdlet which would instantiate the object for me. Cmdlets are easier to discover for most users.

The class has no constructors. It would be nicer (in the current context) to have a constructor so we can pass in a pscredential or username and password during instantiation.

Build-ContainerImage misbehaves with absolute paths

Build-ContainerImage unconditionally appends the provided path with the current powershell user's working directory, but that should only happen for relative paths. Absolute paths should be used directly.

DOCKER_CERT_PATH should not imply TLS is enabled

With docker CLI, DOCKER_CERT_PATH specifies the cert path, but the user still has to specify --tls or --tlsverify or set DOCKER_TLS_VERIFY to turn on TLS.

Probably we should actually make sure we are implementing the verification side (I think we are not) and support DOCKER_TLS_VERIFY.

Update the instruction with how to set the container host.

It is not clear if the module already knows about a container host.
Therefore it may be best to show how to defined or set the host.
I was getting the error below after running Get-ContainerNetwork

PS C:\> Get-ContainerNetwork
Get-ContainerNetwork : The operation has timed out.
At line:1 char:1
+ Get-ContainerNetwork
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ContainerNetwork], TimeoutException
    + FullyQualifiedErrorId : System.TimeoutException,Docker.PowerShell.Cmdlets.GetContainerNetwork

After following the instruction
https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start_configure_host, I was able to get passed the error. Maybe that error could also be friendlier or explicit.

Suggestion: Implement a release pipeline

It would be handy if changes to the master or dev branches kicked off a pipeline to provide:

  • A latest release (perhaps in AppVeyor, similar to the DSC resources)
  • A stable release (perhaps based on tags, and published to the PowerShell Gallery)

This might make it easier for IT folks like myself to pull down the latest version for testing purposes : )

Cheers!

PowerShellGet install instructions for this module do not work

I get this error:

> Install-Module Docker -Repository DockerPS-Dev

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'DockerPS-Dev'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
WARNING: Could not get response from query
'https://ci.appveyor.com/nuget/docker-powershell-dev/package/Docker/0.0.0.35'.
WARNING: MSG:SourceLocationNotValid «https://ci.appveyor.com/nuget/docker-powershell-dev/»
PackageManagement\Install-Package : Package 'Docker' failed to install.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1431 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (C:\Users\hillr\...er\Docker.nupkg:String) [Install-Package], Excep
   tion
    + FullyQualifiedErrorId : PackageFailedInstallOrDownload,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPac
   kage

Need formatting for containers and images

This looks terrible:

> get-containerimage


ID          : sha256:4aa830bd8559eb7e62bf7377f9fe25733df447bd03acdc3d8c80aa9c9668f2f9
ParentID    :
RepoTags    : {windowsservercore:10.0.14331.1001, windowsservercore:latest}
RepoDigests :
Created     : 4/26/2016 1:06:21 AM
Size        : 6871257275
VirtualSize : 6871257275
Labels      :

ID          : sha256:5f7e056d4b596e6bd55fa476c619ca4e267cf314dd1f659603b60ab6e7f7eb7f
ParentID    :
RepoTags    : {nanoserver:10.0.14331.1001, nanoserver:latest}
RepoDigests :
Created     : 4/24/2016 4:21:37 PM
Size        : 648232531
VirtualSize : 648232531
Labels      :

ID          : sha256:865c740600feed63598d91f143954df263c1a86df8e018a568143c47143ceae9
ParentID    :
RepoTags    : {oldwin:latest}
RepoDigests :
Created     : 4/24/2016 4:19:17 PM
Size        : 5913444191
VirtualSize : 5913444191
Labels      :

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.