Automate Multiple Docker image pushes from Docker Hub to Amazon Elastic Container Registry (ECR) using GitHub Actions.
-
Clone the Repository: Clone this GitHub repository to your local machine using the following command:
git clone https://github.com/jrzvnn/docker-ecr-actions
Navigate to the cloned repository directory:
cd docker-ecr-actions
-
GitHub Secrets: Set up the following secrets in your GitHub repository:
AWS_ACCESS_KEY_ID
: Your AWS access key ID.AWS_SECRET_ACCESS_KEY
: Your AWS secret access key.
-
Define Docker Images: To specify the Docker images you want to push to Amazon ECR, open the
scripts.sh
file and modify theIMAGES
array. Add or remove image names as needed. For example:IMAGES=( # Define the list of images to pull and push )
-
Commit and Push: Commit both the workflow YAML file and the script file to your repository.
GitHub Actions will automatically run the workflow on each push to the specified branch, pulling and pushing the Docker images to your ECR repository.
This project is licensed under the MIT License. See LICENSE for details.