Upload
amazon-web-services
View
318
Download
1
Embed Size (px)
Citation preview
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Mitch Beaumont, Solutions Architect
& Shai Perednik, Cloud Infrastructure Architect
November 2017
Introduction to Amazon ECRAmazon EC2 Container Registry
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What will we cover today?
• The AWS Container Ecosystem
• What is Amazon ECR
• Features of Amazon ECR
• Amazon ECR in action
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Shai Perednik
Senior Cloud Infrastructure Architect
AWS Professional Services NYC
20 YRS in IT
Moved from CA -> PA
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The AWS Container Ecosystem
EC2 Container Service
EC2 Container
Registry
ECS
CLI
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is Amazon EC2 Container Registry (ECR)?
Fully Managed Secure Highly Available Simplified Workflow
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Anatomy of a Docker Image
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Docker Images
Packaged
application code
Reproducible Immutable Portable
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Docker Images
747cb2d60bbe
a8bdc7fdaa4f
1f7916b037e5
Layers
Image
Layer Data
hello-ecr:latest
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Typical User Workflow
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Typical User Workflow
I have a Docker
image, and I want to
run the image on a
cluster
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Typical User Workflow
Amazon
ECR
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Typical User Workflow
Amazon
ECS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Typical User Workflow
Amazon
ECS
Amazon
ECR
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ECR Components
Amazon ECR
• Registry & Repository
• Registry Policy
• Image
• Authorization Token
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Pricing & Availability
• Available in 13 regions
• 12-month free tier for 500MB image storage
• $0.10 per GB / month Docker image storage pricing
• Standard AWS Data Transfer Rate
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Features and Integrations
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Container Service Integration
• EC2 instances must have the following IAM permissions:
ecr:BatchCheckLayerAvailability
ecr:BatchGetImage
ecr:GetDownloadUrlForLayer
ecr:GetAuthorizationTokenIAM
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 Container Service Integration
• Use the
AmazonEC2ContainerServiceforEC2Role
managed policy.
• Task definitions must use the full
registry/repository:tag naming for images.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Docker Registry V2 API
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Docker Support
Pulling an Image
$docker pull <registry-uri>/image-name:tag
Docker daemon1. Fetches image manifest at tag
2. For each layer that it doesn’t have:
1. Fetch layer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Docker Support
Pulling an Image
$docker pull <registry-uri>/image-name:tag
Docker daemon1. Fetches image manifest at tag
2. For each layer that it doesn’t have:
1. Fetch layer
Pulling an Image
$docker pull <registry-uri>/image-name:tag
Docker daemon1. GET /v2/<image-name>/manifests/<tag>
2. For each layer that it doesn’t have:
1. GET /v2/<image-name>/blobs/<digest>
HTTP
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon S3 High Availability and Durability
• Highly scalable object storage
• Store and retrieve files from anywhere on the web
• Files are stored as objects and organised in to high-level
folders called buckets
• Supports multi-part upload for large files and event
notifications when objects change
• Files up to 5TB in size
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Team Collaboration
Amazon
ECRteam-a/web-app team-b/web-app
https://205094881157.dkr.ecr.us-west-2.amazonaws.com
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Access Control
instance
Production/web-app
Developer
{ “ecr:PutImage”,“ecr:InitiateLayerUpload”,“ecr:UploadLayerPart”,“ecr:CompleteLayerUpload”,“ecr:GetAuthorizationToken”
}
{“ecr:BatchCheckLayerAvailability”,“ecr:BatchGetImage”,“ecr:GetDownloadUrlForLayer”,“ecr:GetAuthorizationToken”
}
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Encryption
Amazon ECR
AWS KMS
Images
transferred by
HTTPS Automatically
encrypted at rest
using Amazon S3
server-side
encryption
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Third-party Integrations
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Creating a registry
Demo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Pushing and image with the AWS CLI
Demo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Building and Pushing and image with Code*
Demo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Task Definitions and Container Images
Demo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ECR Lifecycle Policies
Demo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Optimising Performance for ECR
• Use Docker 1.10
• Use smaller base images
• Understand your dependencies
• Chain commands
• Use closest regional endpoint
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What we’ve covered today
• ECR is a fully managed Docker
image registry
• Compatible with Docker Registry
v2 API
• Integrates with Amazon EC2
Container Service
• Fine grained access control
• Cloudtrail integration.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!Questions?