Skip to content

To Understand why CodeBuild Image Do not have docker support #6

To Understand why CodeBuild Image Do not have docker support

To Understand why CodeBuild Image Do not have docker support #6

## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
## SPDX-License-Identifier: Apache-2.0
name: Sample App Deployment - Dotnet ECR
on:
workflow_dispatch: # be able to run the workflow on demand
push:
branches:
- "windows-ecr-build-test"
permissions:
id-token: write
contents: read
jobs:
# upload-main-service-image:
# strategy:
# fail-fast: false
# matrix:
# aws-region: [ 'af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-south-2','ap-southeast-1',
# 'ap-southeast-2','ap-southeast-3','ap-southeast-4','ca-central-1','eu-central-1','eu-central-2','eu-north-1',
# 'eu-south-1','eu-south-2','eu-west-1','eu-west-2','eu-west-3','il-central-1','me-central-1','me-south-1', 'sa-east-1',
# 'us-east-1','us-east-2','us-west-1','us-west-2' ]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: ${{ secrets.E2E_IAD_TEST_ACCOUNT_ARN }}
# aws-region: us-east-1
#
# - name: Retrieve account
# uses: aws-actions/aws-secretsmanager-get-secrets@v1
# with:
# secret-ids:
# ACCOUNT_ID, region-account/${{ matrix.aws-region }}
#
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: arn:aws:iam::${{ env.ACCOUNT_ID }}:role/${{ secrets.E2E_TEST_ROLE_ARN }}
# aws-region: ${{ matrix.aws-region }}
#
# - name: Login to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2
#
# - name: Docker compose build
# working-directory: sample-apps/dotnet
# run: |
# docker compose build
#
# - name: Upload Main Service Image
# run: |
# docker tag dotnetsampleapp/frontend-service ${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ secrets.APP_SIGNALS_DOTNET_E2E_FE_SA_IMG }}
# docker push ${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ secrets.APP_SIGNALS_DOTNET_E2E_FE_SA_IMG }}
#
# - name: Upload Remote Service Image
# run: |
# docker tag dotnetsampleapp/remote-service ${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ secrets.APP_SIGNALS_DOTNET_E2E_RE_SA_IMG }}
# docker push ${{ env.ACCOUNT_ID }}.dkr.ecr.${{ matrix.aws-region }}.amazonaws.com/${{ secrets.APP_SIGNALS_DOTNET_E2E_RE_SA_IMG }}
upload-windows-service-image:
strategy:
fail-fast: false
matrix:
aws-region: [ 'us-east-1' ]
runs-on: codebuild-adot-dotnet-runner-windows-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.E2E_IAD_TEST_ACCOUNT_ARN }}
aws-region: us-east-1
- name: Install Docker
run: |
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -OutFile install-docker-ce.ps1
.\install-docker-ce.ps1
- name: Docker test
run: |
docker images
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Docker compose build
working-directory: sample-apps/dotnet
run: |
docker compose -f docker-compose-windows.yaml build