AWS CDK(Python)에서 Codebuild Ubuntu OS 버전 변경

2959 단어 ubuntupythoncdkaws
AWS CDK(Python)를 사용하여 AWS CodePipeline 및 codebuild를 빌드하려고 합니다. 코드는 다음과 같습니다.

from aws_cdk import (
    core,
    aws_codecommit as codecommit,
    aws_codepipeline as codepipeline,
    aws_codepipeline_actions as codepipeline_actions,
    aws_codebuild as codebuild,
    #SecretValue,
    aws_iam as iam,
)
import aws_cdk.aws_ec2 as ec2


class CdkCodePipelineStack(core.Stack):

    def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
        super().__init__(scope, id, **kwargs)

        # The code that defines your stack goes here

        repository = codecommit.Repository.from_repository_name(
            self,
            "RepositoryFromArn",
            "aws-cdk-ecs-python-2",
            )

        source_output = codepipeline.Artifact()
        source_action = codepipeline_actions.CodeCommitSourceAction(
            action_name="Source",
            #owner="githubuser",
            repository=repository,
            #trigger=codepipeline_actions.CodeCommitTrigger.POLL,
            # You'll need to create this secret per the docs
            # https://docs.aws.amazon.com/cdk/api/latest/docs/aws-codepipeline-actions-readme.html#github
            #oauth_token=SecretValue.secrets_manager("github-token"),
            output=source_output,
            branch="master",
        )
        pipeline = codepipeline.Pipeline(
            self,
            "MySimplePipeline",
            stages=[
                codepipeline.StageProps(stage_name="Source", actions=[source_action]),
                codepipeline.StageProps(
                    stage_name="Build",
                    actions=[
                        codepipeline_actions.CodeBuildAction(
                            action_name="Build",
                            # Configure your project here
                            project=codebuild.PipelineProject(self, "MyProject"),
                            input=source_output,

                        )
                    ],
                ),
            ],
        )


buildspec에서 cat/etc/os-release를 실행하면 우분투 버전 18이 표시됩니다. 하지만 최신 버전, 즉 22를 원합니다. 어떻게 해야 하나요? 다음은 cat/etc/os-release의 출력 결과입니다.
[컨테이너] 2022/09/06 06:51:56 cat/etc/os-release 명령 실행

36
NAME="Ubuntu"

37
VERSION="18.04.4 LTS (Bionic Beaver)"

38
ID=ubuntu

39
ID_LIKE=debian

40
PRETTY_NAME="Ubuntu 18.04.4 LTS"

41
VERSION_ID="18.04"

42
HOME_URL="https://www.ubuntu.com/"

43
SUPPORT_URL="https://help.ubuntu.com/"

44
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"

45
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"

46
VERSION_CODENAME=bionic

47
UBUNTU_CODENAME=bionic


여기에서 우분투 버전 22를 어떻게 구할 수 있습니까?

좋은 웹페이지 즐겨찾기