https://github.com/b-n/terraform-aws-s3-container-registry
Create your own public docker v2 compliant container registry
https://github.com/b-n/terraform-aws-s3-container-registry
container container-registry docker
Last synced: about 1 year ago
JSON representation
Create your own public docker v2 compliant container registry
- Host: GitHub
- URL: https://github.com/b-n/terraform-aws-s3-container-registry
- Owner: b-n
- License: mit
- Created: 2023-03-19T15:19:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-01T12:47:34.000Z (over 3 years ago)
- Last Synced: 2025-02-26T11:30:55.615Z (over 1 year ago)
- Topics: container, container-registry, docker
- Language: HCL
- Homepage: https://github.com/b-n/terraform-aws-s3-container-registry
- Size: 29.3 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform S3 Container Registry
Inspiration from https://httptoolkit.com/blog/docker-image-registry-facade/
A statically hosted container registry that matches the is compliant to the
[docker registry v2 API](https://docs.docker.com/registry/spec/api/).
## Purpose
`docker pull registry/image:tag` doesn't do anything particularly special when
pulling images. In fact, there are a couple of quirks when using the docker cli
at least. Failure to specify a `registry` will default the registry to the one
provided by Docker Hub, which will subsequently require you to login.
What if we could host our own registry instead of relying on Docker's free good
will? Well, that is what this terraform module is for.
This terraform module will:
- Create a AWS s3 bucket to store your container images in.
- Put a CloudFront distribution in front of it.
- Put some CloudFront CloudFunctions in place to modify the request and response
to retrieve and return a resource that `docker` CLI can understand.
- Create a s3 bucket for access logs to help in diagnosing any access problems.
## Outputs
- `cloudfront_distribution` - the terraformed CloudFront distribution (for
modifying any related settings)
- `contianer_registry_bucket` - the terraformed bucket where the container blobs
and manifests are stored
- `cloudfront_distribution_domain_name` - the domain name of the distribution
for easy checking after deployment
## What this module does not do
This module does **not** help you with uploading blobs and manifests, and does
**not** support `docker push`. See the [upload container
example](./example-upload-container/README.md) for inspiration.
## Example usage of this module
See the [example](./example/README.md) for an example of using this module.