我正在尝试使用Python3.8为标准的AWS模板构建一个管道。我使用此模板作为管道示例。我对管道所做的唯一改变是环境/图像,我正在将其从3.6.5更改为3.8.3,就像.
CodeBuildProject:
Type: AWS::CodeBuild::Project
Properties:
Name: {{cookiecutter.project_name.lower().replace(' ', '-')}}
Description: Build project for the {{cookiecutter.project_name}}
Artifacts:
Type: CODEPIPELINE
Environment:
Type: LINUX_CONTAINER
ComputeType: BUILD_GENERAL1_SMALL
# Image: aws/codebuild/python:3.6.5 - *Commenting this out*
Image: aws/codebuild/python:3.8.3 - *Using this instead*
EnvironmentVariables:
-
Name: BUILD_OUTPUT_BUCKET
Value: !Ref BuildArtifactsBucket
Cache:
Type: S3
Location: !Sub ${BuildArtifactsBucket}/codebuild-cache
ServiceRole: !GetAtt CodeBuildServiceRole.Arn
Source:
Type: CODEPIPELINE
Tags:
-
Key: "Stack"
Value: !Ref AWS::StackName
-
Key: "Project"
Value: {{cookiecutter.project_name}}问题
我之所以这样做,是因为lambda的运行时是python3.8。如果我将管道的图像保留为aws/codebuild/python:3.6.5,我会得到以下错误.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/aws_lambda_builders/workflow.py", line 58, in wrapper
valid_path = binary_checker.validator.validate(executable_path)
File "/usr/local/lib/python3.6/site-packages/aws_lambda_builders/workflows/python_pip/validator.py", line 45, in validate
raise MisMatchRuntimeError(language=self.language, required_runtime=self.runtime, runtime_path=runtime_path)
aws_lambda_builders.exceptions.MisMatchRuntimeError: python executable found in your path does not match runtime.
Expected version: python3.8, Found version: /usr/local/bin/python.但是,当我将管道的映像更改为aws/codebuild/python:3.8.3时,我在CodeBuild的供应阶段得到了这个错误.
BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE: Unable to pull customer's container image. CannotPullContainerError: Error response from daemon: pull access denied for aws/codebuild/python, repository does not exist or may require 'docker login': denied: requested access to the resource is denied当我搜索"codebuild BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE“时,我发现错误来自于使用自定义构建映像。
我的问题
aws/codebuild/python:3.8.3aws/codebuild/python:3.8.3是一个有效的图像吗?关于#2,我找到了此页,虽然筛选起来有点复杂,但我相信3.8.3是一个有效的图像。
任何帮助,使我的管道运行,将不胜感激。
https://stackoverflow.com/questions/65535533
复制相似问题