1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
I would find a way to reference the same image tag in your cdk app that you use in your image build/tag/push stage.
For example, if you had a docker stage that pushed an image using the environment variable CODEBUILD_RESOLVED_SOURCE_VERSION
as the tag like:
docker build -t $IMAGE_REPO_NAME:$CODEBUILD_RESOLVED_SOURCE_VERSION . docker push $IMAGE_REPO_NAME:$CODEBUILD_RESOLVED_SOURCE_VERSION
You could then reference that tag in your CDK app:
const tag = process.env.CODEBUILD_RESOLVED_SOURCE_VERSION; const image = ecs.ContainerImage.fromEcrRepository(ecrRepo, tag); new ApplicationLoadBalancedFargateService(this, 'Service', { taskImageOptions: { image: image, ... }, ... });
답변함 4년 전