SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
AWS ECR
pg. 1 By: chanaka.lasantha@gmail.com
STORING, MANAGING, AND DEPLOYING DOCKER
CONTAINER IMAGES WITH AMAZON ELASTIC
CONTAINER REGISTRY(ECR).
Wednesday, April 22, 2020
AWS ECR
pg. 2 By: chanaka.lasantha@gmail.com
AWS ELASTIC CONTAINER REGISTRY (ECR) AND LEARN HOW TO DO THE FOLLOWING:
• Create an Amazon ECR repository
• Connect to AWS ECR using Azure CLI
• Push and pull Docker images to ECR
• Manage ECR lifecycle policies
Amazon Elastic Container Registry is a fully managed Docker container registry hosted on the Amazon AWS data centers. The ECR
service is secure, reliable, and scalable, allowing you to grow your applications and services without worrying about capacity and
security.
ECR COMPONENTS:
Components Description
Registry The registry is the primary logical resource that holds all the images.
Authorization token The registry authentication mechanism secures the registry and allows access to authenticated users only.
Repository The repository contains the Docker images.
Repository policy Policies control access and lifecycles.
Images Container images are used with the Docker push and pull commands.
Using these five components, AWS gives you the tools and policies to manage your registry while keeping the images safe and
accessible 24/7 from any location.
Amazon ECR comes with a few limits you should know about in case you are planning to hyperscale the service. Currently, ECR has a
limit of 1,000 repositories per region and 1,000 images per repository, which is very high and probably enough for 99.9 percent of
AWS customers. Make sure you understand these limitations. Based on these two numbers, you can host 1 million container images
per region in AWS.
The next number you should know about is the number of pull and push requests you can run per second, per region, and per account,
which is 200 sustained requests and a burst of 400. AWS uses the same maximum number of layers per image, which is 127 layers
and 100 tags per image.
ECR PRICING:
The Amazon ECR pricing structure is straightforward and based on usage; it doesn’t have any up-front costs. Specifically, the ECR
pricing is based on storage usage, meaning that you pay only for the amount of data that is stored in your repositories and the data
transfer out to the Internet.
FREE TIER ACCOUNT AND ECR:
If you are using a Free Tier AWS account, you get 500MB of free storage for your repositories and 1GB of data transfer over the
Internet. I usually use the data transfer to download my images using the docker pull command. Please note that all uploads using
docker push are free.
AWS ECR
pg. 3 By: chanaka.lasantha@gmail.com
SETTING UP AMAZON ECR:
Amazon AWS best practices recommend that you create a new user account using the AWS Identity and Access Management (IAM)
console for ECR management and administration. Because ECR requires authentication to the service every time you use it, you should
not use your AWS root account to do it. Instead, use a less privileged account.
CREATING AN IAM ACCOUNT:
The first step in the ECR setup process is to create an account that you will use for AWS container management that is separate from
your AWS root account. AWS recommends you create an IAM account for each user and never give your root account details to
anyone.
WHEN YOU CREATE IAM ACCOUNTS AND GROUPS, PLEASE FOLLOW THESE RECOMMENDATIONS:
• When creating new users, make sure you give them access only to the resources they need to do their work and not more.
• When users no longer need access to resources on AWS, revoke their access or reduce their permissions level.
• Use groups when assigning permissions and reduce the need to set up permissions for each user.
• When assigning permissions to groups, try to align the groups with the job role; for example, developers need access to ECR
and ECS but not to billing.
• Try always to grant the least privilege and grant only the required permissions groups need to perform their tasks.
If you are not sure how to get started with groups and permissions, start with AWS managed policies, which are stand-alone policies
created by AWS that define permissions based on common roles that fit many use cases and job functions.
AWS ECR
pg. 4 By: chanaka.lasantha@gmail.com
AWS ECR
pg. 5 By: chanaka.lasantha@gmail.com
AWS ECR
pg. 6 By: chanaka.lasantha@gmail.com
AWS ECR
pg. 7 By: chanaka.lasantha@gmail.com
AWS ECR
pg. 8 By: chanaka.lasantha@gmail.com
AWS ECR
pg. 9 By: chanaka.lasantha@gmail.com
Users with AWS Management Console access can sign-in at: https://753908933348.signin.aws.amazon.com/console
U/N: administrator
P/W: 2)n^@cq#WL88
AWS ECR
pg. 10 By:
chanaka.lasantha@gmail.com
Access key ID: AKIA27CDZMLSJZROAJYA
Secret access key: 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
Reagon: us-east-2
AWS ECR
pg. 11 By:
chanaka.lasantha@gmail.com
aws ec2 describe-regions --output table
vim Dockerfile
FROM ubuntu
ENV DEBIAN_FRONTEND non-interactive
ADD supervisor.conf /etc/supervisor.conf
RUN apt-get -q -y update; apt-get -q -y upgrade && 
apt-get -q -y install sudo openssh-server supervisor vim iputils-ping net-tools && 
apt-get clean all && 
mkdir /var/run/sshd
RUN mkdir -p /app/scripts
WORKDIR /app
RUN useradd -d /home/erp2 -m erp2 > /dev/null 2>&1
RUN echo "/sbin/nologin" >> /etc/shells
RUN usermod -s /sbin/nologin erp2
RUN usermod -u 502 erp2 > /dev/null 2>&1
RUN groupmod -g 504 erp2 > /dev/null 2>&1
RUN echo 'erp2:ccl@123' >> /root/passwdfile
RUN chpasswd -c SHA512 < /root/passwdfile
RUN rm -rf /root/passwdfile
RUN groupadd app
RUN usermod -a -G app erp2
RUN grep 'app' /etc/group
RUN id erp2
RUN echo 'root:z80cpu' >> /root/passwdfile
RUN useradd -m -G sudo chanakan
RUN echo 'chanakan:z80cpu' >> /root/passwdfile
RUN chpasswd -c SHA512 < /root/passwdfile
RUN rm -rf /root/passwdfile
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
EXPOSE 22
VOLUME ["/data"]
AWS ECR
pg. 12 By:
chanaka.lasantha@gmail.com
CMD ["supervisord", "-c", "/etc/supervisor.conf"]
USER root
vim supervisor.conf
[supervisord]
nodaemon=true
[program:sshd]
directory=/usr/local/
command=/usr/sbin/sshd -D
autostart=true
autorestart=true
redirect_stderr=true
Retrieve an authentication token and authenticate your Docker client to your registry.
Use the AWS CLI:
AWS ECR
pg. 13 By:
chanaka.lasantha@gmail.com
aws ecr get-login --region us-east-2 --no-include-email
docker image tag jboss_ready 753908933348.dkr.ecr.us-east-2.amazonaws.com/erp:latest
docker push 753908933348.dkr.ecr.us-east-2.amazonaws.com/erp:latest

Contenu connexe

Tendances

Aws certification training guruprasanth.s
Aws certification training guruprasanth.sAws certification training guruprasanth.s
Aws certification training guruprasanth.s
GURUPRASANTH33
 
Designing Fault Tolerant Applications on AWS - Janakiram MSV
Designing Fault Tolerant Applications on AWS - Janakiram MSVDesigning Fault Tolerant Applications on AWS - Janakiram MSV
Designing Fault Tolerant Applications on AWS - Janakiram MSV
Amazon Web Services
 
Developing And Running A Website On Amazon S E
Developing And Running A Website On Amazon S EDeveloping And Running A Website On Amazon S E
Developing And Running A Website On Amazon S E
jaymuntz
 

Tendances (20)

Amazon EC2
Amazon EC2Amazon EC2
Amazon EC2
 
Aws ec2 setup
Aws ec2 setupAws ec2 setup
Aws ec2 setup
 
Understand AWS OpsWorks - A DevOps Tool from AWS
Understand AWS OpsWorks - A DevOps Tool from AWSUnderstand AWS OpsWorks - A DevOps Tool from AWS
Understand AWS OpsWorks - A DevOps Tool from AWS
 
Serverless architectures on aws
Serverless architectures on awsServerless architectures on aws
Serverless architectures on aws
 
Aws certification training guruprasanth.s
Aws certification training guruprasanth.sAws certification training guruprasanth.s
Aws certification training guruprasanth.s
 
How to copy multiple files from local to aws s3 bucket using aws cli
How to copy multiple files from local to aws s3 bucket using aws cliHow to copy multiple files from local to aws s3 bucket using aws cli
How to copy multiple files from local to aws s3 bucket using aws cli
 
Designing Fault Tolerant Applications on AWS - Janakiram MSV
Designing Fault Tolerant Applications on AWS - Janakiram MSVDesigning Fault Tolerant Applications on AWS - Janakiram MSV
Designing Fault Tolerant Applications on AWS - Janakiram MSV
 
DevOps for the Enterprise: Automating Deployments
DevOps for the Enterprise: Automating DeploymentsDevOps for the Enterprise: Automating Deployments
DevOps for the Enterprise: Automating Deployments
 
AWS November Webinar Series - Get Started with Automated Mobile Application T...
AWS November Webinar Series - Get Started with Automated Mobile Application T...AWS November Webinar Series - Get Started with Automated Mobile Application T...
AWS November Webinar Series - Get Started with Automated Mobile Application T...
 
Amazon EC2: What is this and what can I do with it?
Amazon EC2: What is this and what can I do with it?Amazon EC2: What is this and what can I do with it?
Amazon EC2: What is this and what can I do with it?
 
AWS Elastic Compute Cloud (EC2)
AWS Elastic Compute Cloud (EC2) AWS Elastic Compute Cloud (EC2)
AWS Elastic Compute Cloud (EC2)
 
How to Use AWS Lambda Layers and Lambda Runtime
How to Use AWS Lambda Layers and Lambda RuntimeHow to Use AWS Lambda Layers and Lambda Runtime
How to Use AWS Lambda Layers and Lambda Runtime
 
AWS Fargate Tutorial | AWS Tutorial For Beginners | AWS Certification Trainin...
AWS Fargate Tutorial | AWS Tutorial For Beginners | AWS Certification Trainin...AWS Fargate Tutorial | AWS Tutorial For Beginners | AWS Certification Trainin...
AWS Fargate Tutorial | AWS Tutorial For Beginners | AWS Certification Trainin...
 
Spark access control on Amazon EMR with AWS Lake Formation
Spark access control on Amazon EMR with AWS Lake FormationSpark access control on Amazon EMR with AWS Lake Formation
Spark access control on Amazon EMR with AWS Lake Formation
 
Masterclass Live: Amazon EC2
Masterclass Live: Amazon EC2 Masterclass Live: Amazon EC2
Masterclass Live: Amazon EC2
 
AI in Java and Scala on AWS
AI in Java and Scala on AWSAI in Java and Scala on AWS
AI in Java and Scala on AWS
 
5 Important Points To Remember If You Want To Reduce AWS EC2 Cost
5 Important Points To Remember If You Want To Reduce AWS EC2 Cost5 Important Points To Remember If You Want To Reduce AWS EC2 Cost
5 Important Points To Remember If You Want To Reduce AWS EC2 Cost
 
Developing And Running A Website On Amazon S E
Developing And Running A Website On Amazon S EDeveloping And Running A Website On Amazon S E
Developing And Running A Website On Amazon S E
 
Code Deploy
Code Deploy Code Deploy
Code Deploy
 
Amazon aws 20110611
Amazon aws 20110611Amazon aws 20110611
Amazon aws 20110611
 

Similaire à Storing, Managing, and Deploying Docker Container Images with Amazon ECR

Similaire à Storing, Managing, and Deploying Docker Container Images with Amazon ECR (20)

Handson Lab Log Analytics
Handson Lab Log AnalyticsHandson Lab Log Analytics
Handson Lab Log Analytics
 
WKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot Instances
WKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot InstancesWKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot Instances
WKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot Instances
 
Amazon ECS.pptx tasks conatiner ecs new car
Amazon ECS.pptx tasks conatiner ecs new carAmazon ECS.pptx tasks conatiner ecs new car
Amazon ECS.pptx tasks conatiner ecs new car
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
Cloud computing-Practical Example
Cloud computing-Practical ExampleCloud computing-Practical Example
Cloud computing-Practical Example
 
Getting Started with Serverless and Container Architectures
Getting Started with Serverless and Container ArchitecturesGetting Started with Serverless and Container Architectures
Getting Started with Serverless and Container Architectures
 
WKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot Instances
WKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot InstancesWKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot Instances
WKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot Instances
 
Deep dive into cloud security - Jaimin Gohel & Virendra Rathore
Deep dive into cloud security - Jaimin Gohel & Virendra RathoreDeep dive into cloud security - Jaimin Gohel & Virendra Rathore
Deep dive into cloud security - Jaimin Gohel & Virendra Rathore
 
Intro to Amazon ECS
Intro to Amazon ECSIntro to Amazon ECS
Intro to Amazon ECS
 
intro elastic container service amazon aws
intro elastic container service amazon awsintro elastic container service amazon aws
intro elastic container service amazon aws
 
Aws coi7
Aws coi7Aws coi7
Aws coi7
 
Cloud & Native Cloud for Managers
Cloud & Native Cloud for ManagersCloud & Native Cloud for Managers
Cloud & Native Cloud for Managers
 
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
 
McrUmbMeetup 22 May 14: Umbraco and Amazon
McrUmbMeetup 22 May 14: Umbraco and AmazonMcrUmbMeetup 22 May 14: Umbraco and Amazon
McrUmbMeetup 22 May 14: Umbraco and Amazon
 
AWS re:Invent 2016: Enabling Enterprise Migrations: Creating an AWS Landing Z...
AWS re:Invent 2016: Enabling Enterprise Migrations: Creating an AWS Landing Z...AWS re:Invent 2016: Enabling Enterprise Migrations: Creating an AWS Landing Z...
AWS re:Invent 2016: Enabling Enterprise Migrations: Creating an AWS Landing Z...
 
AWS Certified Solutions Architect Associate Exam Guide 1st Edition 2024_KIRAN...
AWS Certified Solutions Architect Associate Exam Guide 1st Edition 2024_KIRAN...AWS Certified Solutions Architect Associate Exam Guide 1st Edition 2024_KIRAN...
AWS Certified Solutions Architect Associate Exam Guide 1st Edition 2024_KIRAN...
 
EC2 The AWS Compute Service.pptx
EC2 The AWS Compute Service.pptxEC2 The AWS Compute Service.pptx
EC2 The AWS Compute Service.pptx
 
Sameer Mitter | What are Amazon Web Services (AWS)
Sameer Mitter | What are Amazon Web Services (AWS)Sameer Mitter | What are Amazon Web Services (AWS)
Sameer Mitter | What are Amazon Web Services (AWS)
 
Aws principle services: IAM,VPC, EC2, Cloudwatch
Aws principle services: IAM,VPC, EC2, CloudwatchAws principle services: IAM,VPC, EC2, Cloudwatch
Aws principle services: IAM,VPC, EC2, Cloudwatch
 
The AWS DevOps combo (January 2017)
The AWS DevOps combo (January 2017)The AWS DevOps combo (January 2017)
The AWS DevOps combo (January 2017)
 

Plus de Chanaka Lasantha

Free radius for wpa2 enterprise with active directory integration
Free radius for wpa2 enterprise with active directory integrationFree radius for wpa2 enterprise with active directory integration
Free radius for wpa2 enterprise with active directory integration
Chanaka Lasantha
 
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Chanaka Lasantha
 
Complete squid &amp; firewall configuration. plus easy mac binding
Complete squid &amp; firewall configuration. plus easy mac bindingComplete squid &amp; firewall configuration. plus easy mac binding
Complete squid &amp; firewall configuration. plus easy mac binding
Chanaka Lasantha
 
Athenticated smaba server config with open vpn
Athenticated smaba server  config with open vpnAthenticated smaba server  config with open vpn
Athenticated smaba server config with open vpn
Chanaka Lasantha
 
Ask by linux kernel add or delete a hdd
Ask by linux kernel add or delete a hddAsk by linux kernel add or delete a hdd
Ask by linux kernel add or delete a hdd
Chanaka Lasantha
 

Plus de Chanaka Lasantha (20)

Building A Kubernetes App With Amazon EKS
Building A Kubernetes App With Amazon EKSBuilding A Kubernetes App With Amazon EKS
Building A Kubernetes App With Amazon EKS
 
ERP System Implementation Kubernetes Cluster with Sticky Sessions
ERP System Implementation Kubernetes Cluster with Sticky Sessions ERP System Implementation Kubernetes Cluster with Sticky Sessions
ERP System Implementation Kubernetes Cluster with Sticky Sessions
 
Free radius for wpa2 enterprise with active directory integration
Free radius for wpa2 enterprise with active directory integrationFree radius for wpa2 enterprise with active directory integration
Free radius for wpa2 enterprise with active directory integration
 
Distributed replicated block device
Distributed replicated block deviceDistributed replicated block device
Distributed replicated block device
 
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
Configuring apache, php, my sql, ftp, ssl, ip tables phpmyadmin and server mo...
 
Complete squid &amp; firewall configuration. plus easy mac binding
Complete squid &amp; firewall configuration. plus easy mac bindingComplete squid &amp; firewall configuration. plus easy mac binding
Complete squid &amp; firewall configuration. plus easy mac binding
 
Athenticated smaba server config with open vpn
Athenticated smaba server  config with open vpnAthenticated smaba server  config with open vpn
Athenticated smaba server config with open vpn
 
Ask by linux kernel add or delete a hdd
Ask by linux kernel add or delete a hddAsk by linux kernel add or delete a hdd
Ask by linux kernel add or delete a hdd
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmaple
 
One key sheard site to site open vpn
One key sheard site to site open vpnOne key sheard site to site open vpn
One key sheard site to site open vpn
 
Usrt to ethernet connectivity over the wolrd cubieboard bords
Usrt to ethernet connectivity over the wolrd cubieboard bordsUsrt to ethernet connectivity over the wolrd cubieboard bords
Usrt to ethernet connectivity over the wolrd cubieboard bords
 
Site to-multi site open vpn solution with mysql db
Site to-multi site open vpn solution with mysql dbSite to-multi site open vpn solution with mysql db
Site to-multi site open vpn solution with mysql db
 
Site to-multi site open vpn solution. with active directory auth
Site to-multi site open vpn solution. with active directory authSite to-multi site open vpn solution. with active directory auth
Site to-multi site open vpn solution. with active directory auth
 
Site to-multi site open vpn solution-latest
Site to-multi site open vpn solution-latestSite to-multi site open vpn solution-latest
Site to-multi site open vpn solution-latest
 
Install elasticsearch, logstash and kibana
Install elasticsearch, logstash and kibana Install elasticsearch, logstash and kibana
Install elasticsearch, logstash and kibana
 
Oracle cluster installation with grid and nfs
Oracle cluster  installation with grid and nfsOracle cluster  installation with grid and nfs
Oracle cluster installation with grid and nfs
 
Oracle cluster installation with grid and iscsi
Oracle cluster  installation with grid and iscsiOracle cluster  installation with grid and iscsi
Oracle cluster installation with grid and iscsi
 
AUTOMATIC JBOSS CLUSTER MANAGEMENT SYSTEM (PYTHON)
AUTOMATIC JBOSS CLUSTER MANAGEMENT SYSTEM (PYTHON)AUTOMATIC JBOSS CLUSTER MANAGEMENT SYSTEM (PYTHON)
AUTOMATIC JBOSS CLUSTER MANAGEMENT SYSTEM (PYTHON)
 
ully Automatic WSO2 Enterprise Service Bus(ESB) Cluster Management System
ully Automatic WSO2 Enterprise Service Bus(ESB) Cluster Management Systemully Automatic WSO2 Enterprise Service Bus(ESB) Cluster Management System
ully Automatic WSO2 Enterprise Service Bus(ESB) Cluster Management System
 
Docker framework
Docker frameworkDocker framework
Docker framework
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Storing, Managing, and Deploying Docker Container Images with Amazon ECR

  • 1. AWS ECR pg. 1 By: chanaka.lasantha@gmail.com STORING, MANAGING, AND DEPLOYING DOCKER CONTAINER IMAGES WITH AMAZON ELASTIC CONTAINER REGISTRY(ECR). Wednesday, April 22, 2020
  • 2. AWS ECR pg. 2 By: chanaka.lasantha@gmail.com AWS ELASTIC CONTAINER REGISTRY (ECR) AND LEARN HOW TO DO THE FOLLOWING: • Create an Amazon ECR repository • Connect to AWS ECR using Azure CLI • Push and pull Docker images to ECR • Manage ECR lifecycle policies Amazon Elastic Container Registry is a fully managed Docker container registry hosted on the Amazon AWS data centers. The ECR service is secure, reliable, and scalable, allowing you to grow your applications and services without worrying about capacity and security. ECR COMPONENTS: Components Description Registry The registry is the primary logical resource that holds all the images. Authorization token The registry authentication mechanism secures the registry and allows access to authenticated users only. Repository The repository contains the Docker images. Repository policy Policies control access and lifecycles. Images Container images are used with the Docker push and pull commands. Using these five components, AWS gives you the tools and policies to manage your registry while keeping the images safe and accessible 24/7 from any location. Amazon ECR comes with a few limits you should know about in case you are planning to hyperscale the service. Currently, ECR has a limit of 1,000 repositories per region and 1,000 images per repository, which is very high and probably enough for 99.9 percent of AWS customers. Make sure you understand these limitations. Based on these two numbers, you can host 1 million container images per region in AWS. The next number you should know about is the number of pull and push requests you can run per second, per region, and per account, which is 200 sustained requests and a burst of 400. AWS uses the same maximum number of layers per image, which is 127 layers and 100 tags per image. ECR PRICING: The Amazon ECR pricing structure is straightforward and based on usage; it doesn’t have any up-front costs. Specifically, the ECR pricing is based on storage usage, meaning that you pay only for the amount of data that is stored in your repositories and the data transfer out to the Internet. FREE TIER ACCOUNT AND ECR: If you are using a Free Tier AWS account, you get 500MB of free storage for your repositories and 1GB of data transfer over the Internet. I usually use the data transfer to download my images using the docker pull command. Please note that all uploads using docker push are free.
  • 3. AWS ECR pg. 3 By: chanaka.lasantha@gmail.com SETTING UP AMAZON ECR: Amazon AWS best practices recommend that you create a new user account using the AWS Identity and Access Management (IAM) console for ECR management and administration. Because ECR requires authentication to the service every time you use it, you should not use your AWS root account to do it. Instead, use a less privileged account. CREATING AN IAM ACCOUNT: The first step in the ECR setup process is to create an account that you will use for AWS container management that is separate from your AWS root account. AWS recommends you create an IAM account for each user and never give your root account details to anyone. WHEN YOU CREATE IAM ACCOUNTS AND GROUPS, PLEASE FOLLOW THESE RECOMMENDATIONS: • When creating new users, make sure you give them access only to the resources they need to do their work and not more. • When users no longer need access to resources on AWS, revoke their access or reduce their permissions level. • Use groups when assigning permissions and reduce the need to set up permissions for each user. • When assigning permissions to groups, try to align the groups with the job role; for example, developers need access to ECR and ECS but not to billing. • Try always to grant the least privilege and grant only the required permissions groups need to perform their tasks. If you are not sure how to get started with groups and permissions, start with AWS managed policies, which are stand-alone policies created by AWS that define permissions based on common roles that fit many use cases and job functions.
  • 4. AWS ECR pg. 4 By: chanaka.lasantha@gmail.com
  • 5. AWS ECR pg. 5 By: chanaka.lasantha@gmail.com
  • 6. AWS ECR pg. 6 By: chanaka.lasantha@gmail.com
  • 7. AWS ECR pg. 7 By: chanaka.lasantha@gmail.com
  • 8. AWS ECR pg. 8 By: chanaka.lasantha@gmail.com
  • 9. AWS ECR pg. 9 By: chanaka.lasantha@gmail.com Users with AWS Management Console access can sign-in at: https://753908933348.signin.aws.amazon.com/console U/N: administrator P/W: 2)n^@cq#WL88
  • 10. AWS ECR pg. 10 By: chanaka.lasantha@gmail.com Access key ID: AKIA27CDZMLSJZROAJYA Secret access key: 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 Reagon: us-east-2
  • 11. AWS ECR pg. 11 By: chanaka.lasantha@gmail.com aws ec2 describe-regions --output table vim Dockerfile FROM ubuntu ENV DEBIAN_FRONTEND non-interactive ADD supervisor.conf /etc/supervisor.conf RUN apt-get -q -y update; apt-get -q -y upgrade && apt-get -q -y install sudo openssh-server supervisor vim iputils-ping net-tools && apt-get clean all && mkdir /var/run/sshd RUN mkdir -p /app/scripts WORKDIR /app RUN useradd -d /home/erp2 -m erp2 > /dev/null 2>&1 RUN echo "/sbin/nologin" >> /etc/shells RUN usermod -s /sbin/nologin erp2 RUN usermod -u 502 erp2 > /dev/null 2>&1 RUN groupmod -g 504 erp2 > /dev/null 2>&1 RUN echo 'erp2:ccl@123' >> /root/passwdfile RUN chpasswd -c SHA512 < /root/passwdfile RUN rm -rf /root/passwdfile RUN groupadd app RUN usermod -a -G app erp2 RUN grep 'app' /etc/group RUN id erp2 RUN echo 'root:z80cpu' >> /root/passwdfile RUN useradd -m -G sudo chanakan RUN echo 'chanakan:z80cpu' >> /root/passwdfile RUN chpasswd -c SHA512 < /root/passwdfile RUN rm -rf /root/passwdfile RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config EXPOSE 22 VOLUME ["/data"]
  • 12. AWS ECR pg. 12 By: chanaka.lasantha@gmail.com CMD ["supervisord", "-c", "/etc/supervisor.conf"] USER root vim supervisor.conf [supervisord] nodaemon=true [program:sshd] directory=/usr/local/ command=/usr/sbin/sshd -D autostart=true autorestart=true redirect_stderr=true Retrieve an authentication token and authenticate your Docker client to your registry. Use the AWS CLI:
  • 13. AWS ECR pg. 13 By: chanaka.lasantha@gmail.com aws ecr get-login --region us-east-2 --no-include-email docker image tag jboss_ready 753908933348.dkr.ecr.us-east-2.amazonaws.com/erp:latest docker push 753908933348.dkr.ecr.us-east-2.amazonaws.com/erp:latest