AWS CDK(Python)에서 Codebuild Ubuntu OS 버전 변경
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를 어떻게 구할 수 있습니까?
Reference
이 문제에 관하여(AWS CDK(Python)에서 Codebuild Ubuntu OS 버전 변경), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/dipendrachaudhary/changing-codebuild-ubuntu-os-version-in-aws-cdk-python-1b26텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)