Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Terraform module to build & push a Docker image to an AWS ECR repository

Notifications You must be signed in to change notification settings

Truebill/terraform-aws-ecr-docker-image

 
 

Repository files navigation

terraform-aws-ecr-docker-image

Terraform module to build & push a Docker image to an AWS ECR repository.

The image can then be used in an AWS Fargate task.

  • Builds from a Dockerfile in the source path
  • Pushes to an AWS ECR repository
  • Can customize the push and hash scripts
  • Cleans up old images from the repository

Requirements

  • Docker
  • md5sum (e.g. from brew install md5sha1sum)

Usage

See examples.

Inputs

Name Description Type Default Required
hash_script Path to script to generate hash of source contents string "" no
image_name Name of Docker image string n/a yes
push_script Path to script to build and push Docker image string "" no
source_path Path to Docker image source string n/a yes
tag Tag to use for deployed Docker image string "latest" no
repository_policy_path File path to repository policy string null no
dockerfile_name Name of the dockerfile within the specified directory string "Dockerfile" no
target_platform Target platform to build the docker image for string "linux/amd64" no

Outputs

Name Description
hash Docker image source hash
repository_url ECR repository URL of Docker image
tag Docker image tag

About

Terraform module to build & push a Docker image to an AWS ECR repository

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 74.0%
  • Shell 26.0%