How to ensure Docker image update on AWS ECS?

I use the Docker Hub to store a private Docker image, there is a web check in the repository that, after updating the image, calls the service that I created for:

  • update ECS task definition
  • upgrade ECS
  • unregisters the old ECS task definition

The service works accordingly. After starting, ECS creates a new task with a new task definition, stops the task by defining the old task, and the service returns with the new definition.

The fact is that the Docker image is not updated, as soon as the service starts in the new task definition, it remains with the old image.

Am I doing something wrong? How to provide docker image update?

+4
source share
1 answer

After analyzing the AWS ECS logs, I found that the problem was with ECS Docker authentication.

To solve this problem, I added the following data to the /etc/ecs/ecs.config file

ECS_CLUSTER=default
ECS_ENGINE_AUTH_TYPE=dockercfg
ECS_ENGINE_AUTH_DATA={"https://index.docker.io/v1/":{"auth":"YOUR_DOCKER_HUB_AUTH","email":"YOUR_DOCKER_HUB_EMAIL"}}

Just replace YOUR_DOCKER_HUB_AUTH and YOUR_DOCKER_HUB_EMAIL with your own information and it will work properly.

To find this information, you can run docker loginon your own computer and then search the data in the file ~ / .docker / config.json

. http://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html

+4

Source: https://habr.com/ru/post/1624499/


All Articles