Authentication to AWS issue testing docker containers locally

0

I am developing a container image for running on AWS Fargate and have successfully been able to authenticate to AWS from a dev-container using ecs-local-endpoints for authentication.

Problem is that when we try to run that compiled image with docker locally it is not able to authenticate nor to connect to http://169.254.170.2/v3 which is the local URL for ecs-local-endpoints. I have checked that that URL is only accessible from dev-container, as it cannot connect from CMD, PowerShell or from the local container testing it with HTTP GET.

Can you please provide a suggestion on how to overcome this problem? I understand this is done with docker compose, however, how can I do this when running a compiled version locally?

Thanks

preguntada hace un año420 visualizaciones
1 Respuesta
1

Have you followed these instructions? https://aws.amazon.com/blogs/compute/a-guide-to-locally-testing-containers-with-amazon-ecs-local-endpoints-and-docker-compose/

Scenario Three: Testing a Container that uses Task Metadata endpoints The Task Metadata endpoints are useful; they allow a container running on ECS to obtain information about itself at runtime. This enables many use cases; my favorite is that it allows you to obtain container resource usage metrics, as shown by this project.

With Amazon ECS Local Container Endpoints, you can locally test applications that use the Task Metadata V2 or V3 endpoints. If you want to use the V2 endpoint, the Docker Compose template shown at the beginning of this post is sufficient. If you want to use V3, simply add another environment variable to each of your application containers:

ECS_CONTAINER_METADATA_URI: "http://169.254.170.2/v3"

This is the environment variable defined by the V3 metadata spec.

Ensure you are also deploying the ecs-local-endpoints Image as well for your container to access

The Amazon ECS Local Container Endpoints Docker Image

    image: amazon/amazon-ecs-local-container-endpoints
profile picture
EXPERTO
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas