Tag: powershell

如何在Windows10上启动并注册Hyperledger的chaincode

我正试图在Windows10操作系统上启动一个链接代码。 根据这个文件,运行docker-compose -f single-peer-ca.yaml up ,会有一个这样的命令 CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7051 ./chaincode_example02 将启动链码,并且“已收到注册,准备好调用”的消息将会被复制。 在我的Linux环境下,一切顺利,但在我的Windows上,当我将上面的命令input到Powershell时, CORE_CHAINCODE_ID_NAME = mycc:术语“CORE_CHAINCODE_ID_NAME = mycc”不被识别为cmdlet,函数,脚本文件或可操作程序的名称。 检查名称的拼写,或者如果包含path,请validationpath是否正确,然后重试。 在行:1 char:1 + CORE_CHAINCODE_ID_NAME = mycc CORE_PEER_ADDRESS = 0.0.0.0:7051 ./chaincod … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:ObjectNotFound:(CORE_CHAINCODE_ID_NAME = mycc:String)[],CommandNotFoundException + FullyQualifiedErrorId:CommandNotFoundException 很明显,Powershell不能直接将命令识别为linux的terminal。 那么,我应该运行什么命令? 我努力了 docker run –name=node_vp0 -e CORE_CHAINCODE_IF_NAME=mycc -e CORE_PEER_ADDRESS=0.0.0.0:7051 .\chaincode_example02 但Powershell给了我 C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error parsing reference: ".\\chaincode_example02" is […]

在Windows容器上使用复杂的PowerShell脚本构buildDockerfile

我正在尝试使用运行PowerShell的dockerfile来构build一个Docker镜像。 embedded式powershell脚本已经在dockerfile之外进行了testing,但是在运行dockerfile时却有错误。 从docker文件: RUN powershell -NoProfile -Command " \ $lines = (Get-Content c:\telegraf\telegraf.conf).replace('http://localhost:8086', 'http://publichost.com:8086'); \ Set-Content c:\telegraf\telegraf.conf $lines; \ $lines = (Get-Content c:\telegraf\telegraf.conf).replace('database = "telegraf"', 'database = "qa"'); \ Set-Content c:\telegraf\telegraf.conf $lines \ " 我得到了以下错误: At line:1 char:97 + … egraf.conf; $pos = [array]::indexof($lines, $lines -match global_ … + ~ You must provide a value […]

从控制台运行docker

如何通过docker-compose文件运行我的docker? 我已经在Visual Studio 2017中用Docker支持创build了空的ASP.NET Core API项目。 如果我从Visual Studio运行应用程序,我有: Hosting environment: Development Content root path: /app Now listening on: http://email-receipt:80 Application started. Press Ctrl+C to shut down. 然后运行浏览器,我有我的API在http:// localhost:32768 / my-url 但是我怎样才能以相同的方式运行,但在PowerShell控制台? 我运行:docker-compose up,我也有: Starting mydockercont_mydockercont_1 Attaching to mydockercont_mydockercont_1 mydockercont_1 | Hosting environment: Development mydockercont_1 | Content root path: /app mydockercont_1 | Now listening on: http://+:80 […]

Docker for Windows无法启动

我刚刚升级到Windows 10 Pro创build者更新| 1703 | 操作系统版本:15063.138。 当docker试图启动时出现以下错误: Unable to create: You cannot call a method on a null-valued expression. at <ScriptBlock>, <No file>: line 137 at Get-NetAdapter<End>, <No file>: line 181 at New-Switch, <No file>: line 137 at <ScriptBlock>, <No file>: line 381 at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters) at Docker.Backend.ContainerEngine.Linux.Start(Settings settings) at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.<Register>b__0(Object[] parameters) at […]

Windows Powershell以pipe理员身份运行时无法理解连接时的admin

试图连接到Docker,我在terminal中得到这个: PS C:\Windows\System32\WindowsPowerShell\v1.0> docker version Client: Version: 17.03.1-ce API version: 1.27 Go version: go1.7.5 Git commit: c6d412e Built: Tue Mar 28 00:40:02 2017 OS/Arch: windows/amd64 error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.27/version: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. […]

将一个Json文件发布到在Windows 10上运行在Docker,Kitematic上的elasticsearch

我一直在找遍所有的互联网没有任何运气。 我试图将文件fluidflux.json发布到运行在Windows 10上的fluidflux.json镜像,但是没有成功。 任何人都可以帮助我找出适当的Post命令和本地放置文件的位置? 我在Windows Docker“套件”附带的Kitematic Powershell中运行curl。 我装了一个音量: 我把我的文件放在本地文件夹“数据”,并运行我的命令,但没有运气。

Windows cmd docker命令pipe道

我在Windows CMD中find了有关pipe道命令的说明: “pipe道”将程序或命令的输出redirect到第二个程序或命令。 句法: Command1 | Command2 [ 来源 ](在最底部) 然而docker ps -aq | docker start docker ps -aq | docker start或任何类似的组合只是返回错误。 在PowerShell中启动所有停止的容器的唯一工作组合。 docker start $(docker ps -a -q -f "status=exited")

Kubernetes ACS引擎:容器(豆荚)没有互联网访问

我使用的是使用ACS引擎部署在Azure上的Kubernetes集群。 我的集群由5个节点组成。 1个主(unix虚拟机)(v1.6.2) 2 unix代理(v1.6.2) 2 windows代理(v1.6.0-alpha.1.2959 + 451473d43a2072) 我创build了一个由以下YAML定义的unix pod : Name: ping-with-unix Node: k8s-linuxpool1-25103419-0/10.240.0.5 Start Time: Fri, 30 Jun 2017 14:27:28 +0200 Status: Running IP: 10.244.2.6 Controllers: <none> Containers: ping-with-unix-2: Container ID: Image: willfarrell/ping Port: State: Running Started: Fri, 30 Jun 2017 14:27:29 +0200 Ready: True Restart Count: 0 Environment: HOSTNAME: google.com Mounts: […]

通过Powershell使用多个命令启动外部程序

我目前正试图启动一个不同的控制台(.exe)并传递多个命令; 而启动和input一个命令工作得很好,我一直无法找出如何通过PowerShellinput多个。 & "C:\Program Files\Docker Toolbox\start.sh" docker-compose up -d –build 给定的命令工作正常,但提到我需要通过多个命令 – 我尝试使用数组,ScriptBlocks和不同的序列,但无济于事。 编辑 : 注意到docker build有一个-f标签,允许我指定一个文件; 然而,现在的问题似乎是执行cmd删除所有反斜杠和特殊字符,渲染path没有用。 例: &"C:\Program Files\Docker Toolbox\start.sh" 'docker-compose build -f path\to\dockerfile' 将导致错误,指出"pathtodockerfile"是一个无效的path。

手动运行的容器存在与代码145

我试图通过下面的命令手动运行通过Visual Studio 2017,使用docker命令在PowerShell中创build的图像 docker运行-d -p 12345:80 webapplication1:dev 但是容器立即退出Code 145。 PS C:\WINDOWS\system32> docker images REPOSITORY TAG IMAGE ID CREATED SIZE webapplication1 dev b4f4585be3d1 6 minutes ago 305MB PS C:\WINDOWS\system32> docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 41aa3e20e4be webapplication1:dev "dotnet WebApplica…" 11 minutes ago Exited (145) 11 minutes ago condescending_shaw 运行docker日志condescending_shaw显示以下内容 PS C:\WINDOWS\system32> […]