AWS ECS和Docker:不能通过tcp:// <MY-ID> .dkr.ecr.us-east-1.amazonaws.com:2375 / <PROJECT>连接到Docker守护进程。

我试图按照这里的指导持续集成/连续部署: http : //docs.aws.amazon.com/AWSGettingStartedContinuousDeliveryPipeline/latest/GettingStarted/CICD_Jenkins_Pipeline.html

我已经完成了所有的步骤,并且部署了所有的东西,但是在Jenkins中触发构build时出现以下错误:

Cannot connect to the Docker daemon at tcp://<MY-ID>.dkr.ecr.us-east-1.amazonaws.com:2375/hello-world. Is the docker daemon running? 

完整的构build输出如下:

 Started by user <MY_NAME> Building in workspace /var/lib/jenkins/workspace/hello-world > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/securityvoid/hello-world.git # timeout=10 Fetching upstream changes from https://github.com/securityvoid/hello-world.git > git --version # timeout=10 using GIT_SSH to set credentials > git fetch --tags --progress https://github.com/securityvoid/hello-world.git +refs/heads/*:refs/remotes/origin/* > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision 67019adfedd56dd6504ebdaa6430097855c936db (refs/remotes/origin/master) Commit message: "Update readme" > git config core.sparsecheckout # timeout=10 > git checkout -f 67019adfedd56dd6504ebdaa6430097855c936db > git rev-list 67019adfedd56dd6504ebdaa6430097855c936db # timeout=10 [hello-world] $ /bin/bash /tmp/jenkins3002143992924688341.sh Flag --email has been deprecated, will be removed in 1.14. Login Succeeded [hello-world] $ docker build -t hello-world:v_2 --pull=true /var/lib/jenkins/workspace/hello-world Cannot connect to the Docker daemon at tcp://<MY-ID>.dkr.ecr.us-east-1.amazonaws.com:2375/hello-world. Is the docker daemon running? Build step 'Docker Build and Publish' marked build as failure Finished: FAILURE 

有谁知道我在做什么错? 谷歌search错误声明你需要运行Docker服务,但不应该默认在ECS上运行?

我想出了这个问题。 我没有阅读指示,而是将我的Docker Container Registryinput到Jenkins的“registry”字段中,而是将其input到“Doc​​ker Host URI”中。

通过将URL设置为:

 https://<MY-ID>.dkr.ecr.us-east-1.amazonaws.com/hello-world 

这个错误消失了。