无法运行AWS CodeBuild本地构建脚本

问题描述 投票:0回答:2

我正在尝试为我的golang项目在本地运行CodeBuild。我已经拉出docker映像amazon/aws-codebuild-local:latest并运行CodeBuild脚本./codebuild_build.sh -i aws/codebuild/standard:2.0 -s "/project/src",没有任何反应。然后,我捕获了脚本中生成的docker命令:docker run -it -v //var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=aws/codebuild/standard:2.0" -e "SOURCE=/project/src" -e "INITIATOR=me" amazon/aws-codebuild-local:latest

当我运行docker命令时,出现以下错误:

Removing network agent-resources_default
Removing volume agent-resources_source_volume
Removing volume agent-resources_user_volume
Creating network "agent-resources_default" with the default driver
Creating volume "agent-resources_source_volume" with local driver
Creating volume "agent-resources_user_volume" with local driver
Pulling build (aws/codebuild/standard:2.0)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]y
Pulling build (aws/codebuild/standard:2.0)...
ERROR: pull access denied for aws/codebuild/standard, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

我确定我的码头工人已登录,不知道下一步该怎么解决。

amazon-web-services docker go aws-codebuild
2个回答
1
投票

https://aws.amazon.com/blogs/devops/announcing-local-build-support-for-aws-codebuild/,您必须git clone包含这些图像的定义的GitHub存储库:https://github.com/aws/aws-codebuild-docker-images。 aws / codebuild / standard不是DockerHub存储库或有效的ECR存储库。


0
投票

首先按此处所述构建并标记CodeBuild docker映像:

https://github.com/aws/aws-codebuild-docker-images

然后运行以下命令,确保更新命令中的图像名称和标记:

./codebuild_build.sh -i <image_name>:<image_tag> -a /home/ec2-user/environment/artifacts -s /home/ec2-user/environment/sample-web-app
© www.soinside.com 2019 - 2024. All rights reserved.