AWS ECS CodePipeline构建错误REPOSITORY_URI

我们想尝试将CodePipeline与我们在ECR上已经拥有的图像一起使用。

因此,我们按照文档上的步骤进行操作。

我们有这样的buildspec.yml:

import pycurl
try:
    from io import BytesIO
except ImportError:
    from StringIO import StringIO as BytesIO
import datetime
c = pycurl.Curl()
c.setopt(c.URL,r'ftp://ftp.ncbi.nlm.nih.gov/genomes/genbank/archaea/assembly_summary.txt')
c.setopt(pycurl.NOBODY,True)
c.setopt(pycurl.OPT_FILETIME,True)
# Perform request
c.perform()
# Print info
timestamp = c.getinfo(pycurl.INFO_FILETIME)
print(datetime.datetime.fromtimestamp(timestamp))
print(c.getinfo(pycurl.CONTENT_LENGTH_DOWNLOAD))

我们创建了一个新的管道流,但是当我们进行一些更改时,我们会得到以下日志:

$ curl --head ftp://ftp.ncbi.nlm.nih.gov/genomes/genbank/archaea/assembly_summary.txt
Last-Modified: Thu,07 Nov 2019 11:58:21 GMT
Content-Length: 1207490
accept-ranges: bytes

我们想知道是否缺少什么,我们从这里开始以下步骤:

https://aws.amazon.com/es/blogs/devops/build-a-continuous-delivery-pipeline-for-your-container-images-with-amazon-ecr-as-source/

有什么建议吗?

wxp1818118 回答:AWS ECS CodePipeline构建错误REPOSITORY_URI

将有两种可能性:-

一个问题是,您没有在为ec2实例创建的角色中添加ecr和ecs,或者您没有使用弹性beantalk。首先确认

否则,请考虑第二种可能性: 在您的阶段中使用以下命令:-

阶段:   安装:     命令:       -nohup / usr / local / bin / dockerd --host = unix:///var/run/docker.sock --host = tcp://127.0.0.1:2375 --storage-driver = overlay2&       -超时15 sh -c“直到docker info;执行echo。; sleep 1;完成”

有关更多详细信息,请使用此链接 https://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker-custom-image.html#sample-docker-custom-image-files

https://docs.aws.amazon.com/codebuild/latest/userguide/troubleshooting.html#troubleshooting-cannot-connect-to-docker-daemon

,

错误

无法通过unix:///var/run/docker.sock连接到Docker守护程序。是 docker守护程序正在运行?

我发现这很有帮助: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html

具体点5.d。

  1. 直接按照“运行CodeBuild”中的步骤来创建构建项目,运行构建并查看构建信息。

    如果使用控制台创建项目,则:

    a。对于操作系统,选择Ubuntu。

    b。对于运行时,选择标准。

    c。对于Image,选择aws / codebuild / standard:4.0。

    d。因为您使用此构建项目来构建Docker映像,所以请选择Privileged。
,

我遇到了与您相同的问题,我解决的方法如下:尝试转到 CodeBuild,然后转到其 IAM 角色。 AmazonEC2ContainerRegistryFullAccess 角色,现在单击该代码构建的“编辑”并选择“环境”并单击 Allow AWS CodeBuild to modify this service role so it can be used with this building project。现在再试一次。

干杯

本文链接:https://www.f2er.com/3141057.html

大家都在问