CDK V2 remote Docker Images building

0

In my CDK project, I use a lot of Docker images for various services. These images are for different platforms, since Fargate doesn't support Spot ARM64. Building all of these images on my own machine (an Apple M1 Pro) can be quite cumbersome.

Out of curiosity, I was wondering if there is a convenient way to build these Docker images on AWS. Ideally, when I run 'cdk deploy --all', it would upload my assets to AWS, build the Docker images, and publish the results on ECR.

Do you have any ideas on how I could achieve this?

1개 답변
0

Hi Smotrov,

Typically CDK is meant for infrastructure as code, so building the image per se is not part of that.

What you can do is to provision native cloud pipelines in cdk, that allow you to build the images.

An example is code pipeline and code build where you can build a docker image: https://github.com/aws-samples/aws-cdk-examples/blob/master/python/codepipeline-docker-build/ReadMe.md

So if you wish to execute the building of the image with cdk, I d create a script that executes both cdk deploy and that triggers a code pipeline starts.

Hope it helps and fits your case

profile picture
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠