Bamboo:docker任务“尝试连接时发生错误:Post http://127.0.0.1:2375/v1.22/build" [英] Bamboo: docker task "An error occurred trying to connect: Post http://127.0.0.1:2375/v1.22/build"

查看:1306
本文介绍了Bamboo:docker任务“尝试连接时发生错误:Post http://127.0.0.1:2375/v1.22/build"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用Bamboo设置一个Continuous Delivery服务器。我已经完成了所有的部署。 Bamboo构建并测试我的C#项目。



然后,我创建了一个部署计划,安装了Docker并添加了使用docker的服务器功能,设置了docker任务来构建和部署到dockerHub。 >

当我尝试部署时,我收到这个错误:



尝试连接时出错:发布http://127.0.0.1:2375/v1.22/build?buildargs =%7B%7D& cgroupparent =& cpuperiod = 0& cpuquota = 0& cpusetcpus =& cpusetmems =& cpushares = 0& dockerfile = Dockerfile& forcerm = 1& memory = 0& memswap = 0& rm = 1& shmsize = 0& t = srgskiri%2Fresttest& ulimits = null:dial tcp 127.0.0.1:2375:connectex:目标机积极拒绝。


01-mrt-2016 13:19:03从[C:\Program Files\ Docker Toolbox\docker.exe build --force-rm = true --tag =srgskiri / resttestC:\Users\Srg\bamboo-home\xml-data\build-dir\2129921 -2195457]是1,而预期0



现在我认为这意味着正在调用命令构建的竹子对象,不能与我的docker引擎/容器通信。



首先我以为是因为没有docker机器运行,所以我启动它并运行部署,但仍然有这个错误。



这是我有的:



服务器功能:到Docker的路径



Docker任务:构建成图像



是否我缺少的东西?



PS:Docker工作完美独立于Docker UI或码头码头终端。这是竹子,不能与码头工作人员互动。



更新:我没有提到这一点,但是我在控制台里跑了竹子作为服务。也许就是这个问题,那竹子不能把docker从控制台上拿出来。我现在无法自己尝试,因为我无法安装竹子作为服务。如果我尝试启动它作为一个服务,保持悬挂。
请问竹子支持。

解决方案

我想出来...如果你在Windows上工作竹子必须启动码头机器本身。



所以你必须添加命令任务到:



1)创建码头机(如果你还没有)



2)启动它(如果你在竹子中启动码头工具,你不能访问它在Windows中)



只有这样,您才能在Windows上使用Bamboo中的Docker。



我现在感到愚蠢



-EDIT - 要在启动Docker-machine之后使用Docker任务,您还必须指定任务(如DOCKER_TLS_VERIFY = 1)
否则您会收到上述错误。


I've been trying to set up an Continuous Delivery server with Bamboo. I've got everything going nicely up to the deployment. Bamboo builds and tests my C# project as it should.

Then I created a "deployment plan", installed docker and added the server capability to use docker, set up the docker tasks to build and deploy to dockerHub.

When I try to deploy, I get this error:

An error occurred trying to connect: Post http: //127.0.0.1:2375/v1.22/build ?buildargs=%7B%7D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&forcerm=1&memory=0&memswap=0&rm=1&shmsize=0&t=srgskiri%2Fresttest&ulimits=null : dial tcp 127.0.0.1:2375: connectex: No connection could be made because the target machine actively refused it. 01-mrt-2016 13:19:03 Failing task since return code of [C:\Program Files\Docker Toolbox\docker.exe build --force-rm=true --tag="srgskiri/resttest" C:\Users\Srg\bamboo-home\xml-data\build-dir\2129921-2195457] was 1 while expected 0

Now I think that it means that the bamboo 'object' that is calling the command to build, can't communicate with my docker engine/container.

First I thought it was because I didn't have docker-machine running, so I started it and ran the deploy, and still got this error.

This is what I have:

Server capability: path to docker

Docker task: building into an Image

Is there something I'm missing?

PS: Docker works perfectly on its own, both with docker UI or docker terminal. It's bamboo that can't interact with docker.

UPDATE: I didn't mention this, but I ran Bamboo in a Console, not as a service. Maybe thats the problem, that bamboo can't access docker out of console. I can't try this myself now because I can't install bamboo as a service. Keeps hanging if I try to start it as a service. Will ask the bamboo support about it.

解决方案

I figured it out... If u work on a Windows, Bamboo has to start the docker-machine itself.

So you have to add Command tasks to:

1) create a docker-machine (if u don't have any yet)

2) start it (if you start docker in bamboo, you can't access it in Windows and vice-versa)

only then you are able to use Docker in Bamboo on Windows.

I feel silly now

-EDIT- To use the Docker tasks after starting the docker-machine, you must also specify the Environment variables for the tasks (like DOCKER_TLS_VERIFY=1) Otherwise you'll get the error mentioned above.

这篇关于Bamboo:docker任务“尝试连接时发生错误:Post http://127.0.0.1:2375/v1.22/build"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆