Skip to content
This repository was archived by the owner on Sep 13, 2019. It is now read-only.

samuelkarp/amazon-ecr-containerd-resolver-ARCHIVED

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Amazon ECR containerd resolver

Build Status

The Amazon ECR containerd resolver is an implementation of a containerd Resolver, Fetcher, and Pusher that can pull images from Amazon ECR and push images to Amazon ECR using the Amazon ECR API instead of the Docker Registry API.

Note: This repository is a proof-of-concept and is not recommended for production use.

Usage

Pull images

resolver, _ := ecr.NewResolver()
img, err := client.Pull(
    namespaces.NamespaceFromEnv(context.TODO()),
    "ecr.aws/arn:aws:ecr:us-west-2:123456789012:repository/myrepository:mytag",
    containerd.WithResolver(resolver),
    containerd.WithPullUnpack,
    containerd.WithSchema1Conversion)

Push images

ctx := namespaces.NamespaceFromEnv(context.TODO())

img, _ := client.ImageService().Get(
	ctx,
	"docker.io/library/busybox:latest")
resolver, _ := ecr.NewResolver()
err = client.Push(
	ctx,
	"ecr.aws/arn:aws:ecr:us-west-2:123456789012:repository/myrepository:mytag",
	img.Target,
	containerd.WithResolver(resolver))

Two small example programs are provided in the example directory demonstrating how to use the resolver with containerd.

ref

containerd specifies images with a ref. refs are different from Docker image names, as refs intend to encode an identifier, but not a retrieval mechanism. refs start with a DNS-style namespace that can be used to select separate Resolvers to use.

The canonical ref format used by the amazon-ecr-containerd-resolver is ecr.aws/ followed by the ARN of the repository and a label and/or a digest.

Building

The Amazon ECR containerd resolver manages its dependencies with Go 1.11 modules and works best when used with Go 1.11 or greater. If you have Go 1.11 or greater installed, you can build the example programs with make.

License

The Amazon ECR containerd resolver is licensed under the Apache 2.0 License.

About

The Amazon ECR containerd resolver is an implementation of a containerd Resolver and Fetcher that can pull images from and push images to Amazon ECR using the Amazon ECR API instead of the Docker Registry API.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors