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 Antwort
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
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen