Skip to content

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

Notifications You must be signed in to change notification settings

mathspace/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

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

Contributors 3

  •  
  •  
  •