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 Resposta
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
respondido há um ano

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas