This project was created to keep the images that are in the AWS ECR (Amazon Elastic Container Registry) updated with the official images.
We were working on a way to centralize the images in our ECR repository, to implement a security lock to prevent external image downloads. We ran into a problem, we would have to manually update these images in our repository on a regular basis or they would get out of date. Thus came the idea of the UPDATE-LOCAL-IMAGE project.
- Connections:
- AWS ECR Login: The module logs in to AWS ECR with the proper credentials.
- AWS ECR logout: The module logout at the end of execution.
- Download images: Downloads ECR and external images.
- Image hash comparison: The module extracts the hash of the image that is in the AWS ECR and in the external image and compares them.
- Preparation of images:
- Creating a list of repositories: The module creates a list with all the repositories that contain the name "base/image".
- Creation of a list of tags: The module creates a list of all the tags that exist within each repository.
- Image TAG: Tag creation.
- Image Push: Sends the image to AWS ECR.
- Send notifications: Send message with execution summary to discord
| Name | Descriptions |
|---|---|
| DISCORD_WEBHOOK | Webhook for sending execution message to discord |
| ECR | Address of your AWS ECR repository |
| keyword | Word in common with the repositories you want to run |
- Replace the values of the ECR and Keyword variable
- Ensure your AWS credentials configuration is correct
- python3 ./main.py
This project is executed via pipeline to send the execution notification message on discord in the steps below.
- 'echo "{\"content\": \"Updated images!\n$(cat result_update.txt)\"}" > result.json'
- 'curl -X POST -H "Content-Type: application/json" -d @result.json ${DISCORD_WEBHOOK}'
- 'echo "{\"content\": \"Images not updated!\n$(cat result_notupdate.txt)\"}" > result.json'
- 'curl -X POST -H "Content-Type: application/json" -d @result.json ${DISCORD_WEBHOOK}'
Python
1.0.0
Nome: Diego Alves Dias
E-mail: dias.ti@outlook.com
Data: 10/07/2023
Nome:
E-mail:
Data: