시가총액: $2.7146T 0.440%
거래량(24시간): $72.5237B 46.620%
  • 시가총액: $2.7146T 0.440%
  • 거래량(24시간): $72.5237B 46.620%
  • 공포와 탐욕 지수:
  • 시가총액: $2.7146T 0.440%
Cryptos
주제
Cryptospedia
소식
CryptosTopics
비디오
Top News
Cryptos
주제
Cryptospedia
소식
CryptosTopics
비디오
bitcoin
bitcoin

$83613.281522 USD

-0.31%

ethereum
ethereum

$1907.196020 USD

-0.12%

tether
tether

$0.999991 USD

-0.02%

xrp
xrp

$2.346667 USD

-0.01%

bnb
bnb

$638.706352 USD

6.12%

solana
solana

$128.851013 USD

-3.46%

usd-coin
usd-coin

$1.000040 USD

0.01%

dogecoin
dogecoin

$0.173959 USD

1.06%

cardano
cardano

$0.724425 USD

-0.57%

tron
tron

$0.214243 USD

-1.65%

pi
pi

$1.351541 USD

-9.35%

unus-sed-leo
unus-sed-leo

$9.827847 USD

0.06%

chainlink
chainlink

$13.795794 USD

-1.22%

toncoin
toncoin

$3.420442 USD

0.21%

stellar
stellar

$0.273472 USD

1.29%

암호화폐 뉴스 기사

AWS CodeBuild 및 Github 동작으로 다중 아키텍처 컨테이너 이미지 구축

2025/03/14 08:34

컴퓨팅의 환경이 계속 발전함에 따라 다양한 컴퓨팅 아키텍처를 지원하는 데 중점을두고 있습니다.

AWS CodeBuild 및 Github 동작으로 다중 아키텍처 컨테이너 이미지 구축

This blog was authored by Zakiya Randall, Technical Account Manager and co-written with Muru Bhaskaran, Sr. Specialist Solutions Architect.

이 블로그는 기술 계정 관리자 인 Zakiya Randall이 작성했으며 Sr. Specialist Solutions Architect 인 Muru Bhaskaran과 공동 저술했습니다.

As the landscape of computing continues to evolve, there is a growing emphasis on supporting a diverse range of computing architectures. This shift is driven by the need for flexibility, efficiency, and performance optimization across different hardware platforms. Consequently, it has become increasingly important for developers and organizations to build container images that are compatible with multiple architectures (multi-arch).

컴퓨팅의 환경이 계속 발전함에 따라 다양한 컴퓨팅 아키텍처를 지원하는 데 중점을두고 있습니다. 이러한 변화는 다양한 하드웨어 플랫폼에서 유연성, 효율성 및 성능 최적화의 필요성에 의해 주도됩니다. 결과적으로 개발자와 조직이 여러 아키텍처 (Multi-Arch)와 호환되는 컨테이너 이미지를 구축하는 것이 점점 중요 해지고 있습니다.

AWS CodeBuild is a fully managed continuous integration service that now supports managed GitHub Actions runners, which are self-hosted runners that allow users to configure their CodeBuild projects to receive GitHub Actions workflow job events. In this post, we demonstrate a solution that uses GitHub, GitHub Actions workflows, and CodeBuild to build native container images for both x86 and AWS Graviton-based compute on AWS. Upon completion of our GitHub Actions workflow, we will proceed to push our multi-arch images to Amazon Elastic Container Registry (Amazon ECR).

AWS CodeBuild는 현재 관리되는 GitHub Actions Runners를 지원하는 완전히 관리되는 지속적인 통합 서비스로, 사용자가 CodeBuild 프로젝트를 구성하여 GitHub Actions 작업 플로우 작업 이벤트를 수신 할 수있는 자체 호스트 러너입니다. 이 게시물에서는 GitHub, GitHub Actions 워크 플로 및 CodeBuild를 사용하여 AWS의 X86 및 AWS Graviton 기반 컴퓨팅 모두에 대한 기본 컨테이너 이미지를 구축하는 솔루션을 시연합니다. GitHub Actions Workflow가 완료되면 Multi-Arch 이미지를 Amazon Elastic Container Registry (Amazon ECR)로 푸시합니다.

Solution overview

솔루션 개요

The architecture diagram illustrates the workflow that occurs upon committing a change to the GitHub repository, detailing the subsequent steps involved in pushing the container image to Amazon ECR.

아키텍처 다이어그램은 Github 저장소로 변경을 저지른 작업 플로우를 보여 주며 컨테이너 이미지를 Amazon ECR로 푸시하는 데 관련된 후속 단계를 자세히 설명합니다.

Figure 1: Solution architecture diagram

그림 1 : 솔루션 아키텍처 다이어그램

Prerequisites

전제 조건

The following prerequisites are necessary to complete this solution:

이 솔루션을 완료하려면 다음과 같은 전제 조건이 필요합니다.

Walkthrough

연습

The following steps walk you through this solution.

다음 단계는이 솔루션을 안내합니다.

Creating GitHub repository files

github 리포지토리 파일 생성

To begin creating the solution, you need a GitHub repository to store the Dockerfile, index.html file, and GitHub Actions workflow YAML file. Refer to Creating a new GitHub repository for step by step instructions. For this example, the following files should be committed to the root of the GitHub repository.

솔루션을 만들려면 dockerfile, index.html 파일 및 github 작업 워크 플로우 Yaml 파일을 저장하려면 github 저장소가 필요합니다. 단계별 지침은 새로운 Github 저장소 작성을 참조하십시오. 이 예에서는 다음 파일이 Github 저장소의 루트에 커밋되어야합니다.

Create two CodeBuild projects for the x86 and arm64 compute architectures

X86 및 ARM64 Compute Architectures에 대한 두 개의 CodeBuild 프로젝트 작성

You must create two CodeBuild projects to run your GitHub Actions jobs. Your CodeBuild projects should follow the following naming structure for -x86 and -arm64. Refer to the following tutorial to set up two CodeBuild projects for the x86 and arm64 compute environments. You should use the OAuth app authentication method to connect with your GitHub repository. For the x86 and arm64 CodeBuild projects, choose a supported environment image that matches each compute architecture. Your Buildspec build specifications are ignored. Instead, CodeBuild overrides it to use commands that setup the compute runner.

GitHub 작업 작업을 실행하려면 두 개의 CodeBuild 프로젝트를 작성해야합니다. CodeBuild 프로젝트는 -x86 및 -arm64에 대한 다음 명명 구조를 따라야합니다. X86 및 ARM64 Compute Environments에 대한 두 개의 CodeBuild 프로젝트를 설정하려면 다음 자습서를 참조하십시오. Oauth 앱 인증 방법을 사용하여 Github 저장소에 연결해야합니다. X86 및 ARM64 CodeBuild 프로젝트의 경우 각 컴퓨팅 아키텍처와 일치하는 지원되는 환경 이미지를 선택하십시오. BuildSpec 빌드 사양은 무시됩니다. 대신 CodeBuild는이를 무시하고 Compute Runner를 설정하는 명령을 사용합니다.

Figure 2: CodeBuild Projects for x86 and arm64

그림 2 : X86 및 ARM64의 코드 빌드 프로젝트

Create an Amazon ECR repository

Amazon ECR 저장소를 만듭니다

You also need to create an Amazon ECR repository to store the x86 and arm64 container images. Run the following AWS CLI command to create an Amazon ECR repository.

또한 X86 및 ARM64 컨테이너 이미지를 저장하려면 Amazon ECR 저장소를 작성해야합니다. 다음 AWS CLI 명령을 실행하여 Amazon ECR 저장소를 작성하십시오.

After creating and defining your Amazon ECR repository, you must define a role so that the CodeBuild runners can have permission to access and push your images to your Amazon ECR repository. The following role that you create allows you to push images to your Amazon ECR repository.

Amazon ECR 저장소를 작성하고 정의 한 후 CodeBuild Runners가 이미지에 액세스하고 Amazon ECR 저장소에 푸시 할 수 있도록 역할을 정의해야합니다. 다음과 같은 역할을 통해 이미지를 Amazon ECR 저장소로 푸시 할 수 있습니다.

After creating the policy, go to the AWS Identity and Access Management (IAM) console to create an Identity Provider and choose OpenID Connect. For the Provider URL, choose https://token.actions.githubusercontent.com. For the Audience, choose sts.amazonaws.com.

정책을 작성한 후 AWS Identity and Access Management (IAM) 콘솔로 이동하여 ID 제공 업체를 작성하고 OpenID Connect를 선택하십시오. 제공자 URL의 경우 https://token.action.githubusercontent.com을 선택하십시오. 청중은 sts.amazonaws.com을 선택하십시오.

2. After you create the provider, create a role and choose Web Identity. In the drop-down box, you should see the Provider URL for https://token.actions.githubusercontent.com. Choose this option and specify sts.amazonaws.com for your Audience. In the GitHub organization, specify your GitHub Organization and add the repository that you created in the initial setup. Choose Next.

2. 제공자를 만들면 역할을 만들고 웹 아이덴티티를 선택하십시오. 드롭 다운 상자에는 https://token.actions.githubusercontent.com의 제공자 URL이 표시됩니다. 이 옵션을 선택하고 청중을 위해 sts.amazonaws.com을 지정하십시오. GitHub 조직에서 GitHub 조직을 지정하고 초기 설정에서 만든 저장소를 추가하십시오. 다음을 선택하십시오.

Figure 3: Example of creating the role

그림 3 : 역할 만들기의 예

3. On the Add Permissions page, choose the policy that you created in Step 1 so that you can push images to Amazon ECR. Choose Next. On the next screen, name the role and choose Create role.

3. 권한 추가 페이지에서 1 단계에서 만든 정책을 선택하여 이미지를 Amazon ECR로 푸시 할 수 있습니다. 다음을 선택하십시오. 다음 화면에서 역할을 지정하고 역할 창출을 선택하십시오.

Figure 4: Example of adding policy permissions

그림 4 : 정책 권한 추가 예

4. Go to Settings within your GitHub repository, and under Security in the left pane, choose Secrets and Variables. Choose the Actions tab within Secrets and Variables. Choose New repository secret. For the name, enter AWS_ROLE_ARN, enter the AWS Role ARN of the role that you created in Step 3, and choose Add secret.

4. GitHub 저장소 내 설정으로 이동하여 왼쪽 창의 보안하에 비밀과 변수를 선택하십시오. 비밀과 변수 내에서 동작 탭을 선택하십시오. 새로운 저장소 비밀을 선택하십시오. 이름의 경우 AWS_ROLE_ARN을 입력하고 3 단계에서 만든 역할의 AWS 역할 ARN을 입력하고 비밀을 추가하십시오.

Figure 5: Example of creating GitHub Actions secret for the AWS Role

그림 5 : AWS 역할에 대한 비밀 Github 액션 생성 예

5. Create another New repository secret for AWS_REGION. Specify the Region in which you created your resources and choose Add secret.

5. AWS_REGION에 대한 또 다른 새로운 저장소 비밀을 만듭니다. 자원을 만든 영역을 지정하고 비밀을 추가하십시오.

Figure 6: Example of GitHub Actions secret for the AWS Region

그림 6 : AWS 지역의 GitHub Actions Secret의 예

Prepare GitHub Actions workflow

GitHub 작업 워크 플로를 준비하십시오

A GitHub Actions workflow is a configurable automated process made up of one or more jobs and you can define these jobs in a YAML file. You are going to create a YAML file in the .github/workflows directory within your GitHub repository that defines the workflow for the solution. The YAML file for your GitHub Actions workflow contains the build

GitHub 작업 워크 플로는 하나 이상의 작업으로 구성된 구성 가능한 자동화 프로세스이며 YAML 파일에서 이러한 작업을 정의 할 수 있습니다. 솔루션의 워크 플로를 정의하는 GitHub 저장소 내 .github/Workflows 디렉토리에 YAML 파일을 만들려고합니다. GitHub Actions의 YAML 파일 워크 플로우에는 빌드가 포함됩니다.

부인 성명:info@kdj.com

제공된 정보는 거래 조언이 아닙니다. kdj.com은 이 기사에 제공된 정보를 기반으로 이루어진 투자에 대해 어떠한 책임도 지지 않습니다. 암호화폐는 변동성이 매우 높으므로 철저한 조사 후 신중하게 투자하는 것이 좋습니다!

본 웹사이트에 사용된 내용이 귀하의 저작권을 침해한다고 판단되는 경우, 즉시 당사(info@kdj.com)로 연락주시면 즉시 삭제하도록 하겠습니다.

2025年03月17日 에 게재된 다른 기사