How to user ECR Public Gallery images with CDK

0

I'm trying to deploy SonarQube community edition with CDK. Image seems to available in ECR Public Gallery (public.ecr.aws/docker/library/sonarqube:community) , but how to use it in CDK as ContainerImage.fromRegistry seems to point to docker.io by default?

    const container = new ContainerDefinition(this, 'container',{
      image: ContainerImage.fromRegistry("docker/library/sonarqube:community")

With this, ECS tries to pull image from docker.io/docker/library/sonarqube:community and fails as it cant' be resolved

1 Answer
0

From the CDK documentation:

Type: ContainerImage The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. TODO: Update these to specify using classes of IContainerImage

Another alternate is to check if you can use - fromEcrRepository as defined here

--Syd

profile picture
Syd
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions