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 réponse
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
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions