我正在尝试按照此处的指南进行持续集成/持续部署: http://docs.aws.amazon.com/AWSGettingStartedContinuousDeliveryPipeline/latest/GettingStarted/CICD_Jenkins_Pipeline.html
我已经完成了所有步骤并且部署了所有内容,但是在Jenkins中触发构建时出现以下错误:
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?
完整的构建输出如下:
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
有谁知道我做错了什么?谷歌搜索它所声明的错误你需要运行Docker服务,但默认情况下不应该在ECS上运行吗?
答案 0 :(得分:3)
我想出了这个问题。我没有阅读说明,而是没有进入我的Docker Container Registry进入&#34;注册表&#34;詹金斯的领域,我把它输入了#Docked Host URI&#34;。
将网址设置为:
https://<MY-ID>.dkr.ecr.us-east-1.amazonaws.com/hello-world
此错误消失了。