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 Risposta
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
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande