Невозможно автоматически связать папку тома внутри Docker-контейнера с помощью сценария powershell

Я новичок в докере. Я пытаюсь автоматизировать вещи. У меня есть сценарий powershell, который создает экземпляр Windows AWS, устанавливает докер и извлекает образ из центра докера. Я пытаюсь связать том с докером-контейнером, чтобы я мог автоматически перемещать файлы из контейнера на локальную машину.

Invoke-Command -Session $r {docker volume create volume01}
Invoke-Command -Session $r {docker pull 474614/my_repo:javaprogram}
Invoke-Command -Session $r {docker images}
Invoke-Command -Session $r {docker run --name test01 -it -v c:\programdata\docker\volumes\volume01:c:\volume01 474614/my_repo:Accessibility cmd}

я получаю показанную ниже ошибку:

the input device is not a TTY.  If you are using mintty, try prefixing the command with 'winpty'
    + CategoryInfo          : NotSpecified: (the input devic...d with 'winpty':String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
    + PSComputerName        : ec2-52-28-216-45.eu-central-1.compute.amazonaws.com

я попытался запустить команду, как показано ниже:

Invoke-Command -Session $r {winpty docker run --name test01 -it -v c:\programdata\docker\volumes\volume01:c:\volume01 

мне показывают:

winpty : The term 'winpty' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ winpty docker run --name test01 -it -v c:\programdata\docker\volumes\ ...
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (winpty:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Версия докера:

PS C: \ Users \ Администратор> версия докера

Client:
 Version:      17.03.1-ee-3
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   3fcee33
 Built:        Thu Mar 30 19:31:22 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.03.1-ee-3
 API version:  1.27 (minimum version 1.24)
 Go version:   go1.7.5
 Git commit:   3fcee33
 Built:        Thu Mar 30 19:31:22 2017
 OS/Arch:      windows/amd64
 Experimental: false

если winpty требуется для запуска docker на устройстве, отличном от TTY. Как бы я загрузить WinPTY для Windows Server 2016 через PowerShell. Любой совет по этому вопросу будет полезен. Заранее спасибо.

0 ответов

Другие вопросы по тегам