Skip to main content
38 votes
Accepted

Can I use AWS ECR image directly in my Dockerfile?

The same pattern you use in docker push works: FROM 1234567890.dkr.ecr.us-west-2.amazonaws.com/mycompany:latest
Jason Martin's user avatar
  • 5,113
26 votes

Docker login to AWS ECR from GitLab CI fails with "dial tcp: lookup docker on x.x.x.x:53: no such host" when pulling docker:dind from ECR

To resolve this problem just add on /etc/gitlab-runner/config.toml a volume map to docker sock. volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
Anderson Dapper's user avatar
23 votes

How to connect to AWS ECR using python docker-py

Complete code example that works: #!/usr/bin/env python3 import base64, docker, boto3 docker_client = docker.from_env(version='1.24') ecr_client = boto3.client('ecr', region_name='eu-west-1') token =...
Otto's user avatar
  • 331
16 votes
Accepted

What is the proper way to log in to ECR?

Tinkering around this seems to work well: aws ecr get-login-password | docker login -u AWS --password-stdin "https://$(aws sts get-caller-identity --query 'Account' --output text).dkr.ecr.us-east-1....
Moak's user avatar
  • 802
9 votes

AWS ECR - Push Successful, Image Does Not Appear in Repo

We have noticed that the AWS ECR Repositories Console does not list recently pushed/tagged images in real time. Link: https://console.aws.amazon.com/ecs/home?region=us-east-1#/repositories (specify ...
johnsampson's user avatar
8 votes

How to connect to AWS ECR using python docker-py

I have found it to be easiest to pass an auth_config with username/password when pushing the image to ECR. import boto3 import base64 import docker sess = boto3.Session() resp = sess.client('ecr')....
Martin's user avatar
  • 181
8 votes
Accepted

Give one user read-only access to ECR repo

That may be better achieved through IAM Policy for the User instead of doing it on the ECR repo level. Try this as a IAM policy for a_user (read-only): { "Version": "2012-10-17", ...
MLu's user avatar
  • 25.7k
8 votes

How to connect to AWS ECR using python docker-py

I have faced the same problem, you have to: decode from base64 convert from byte to string separate the login 'AWS' password = (base64.b64decode(response['authorizationData'][0]['...
Sergii Shapovalenko's user avatar
7 votes
Accepted

How to connect to AWS ECR using python docker-py

Login Fail dockerClient refuses the connection with "bad username or password" The signature of the function you are calling to login is: def login(self, username, password=None, email=...
Stephen Rauch's user avatar
7 votes

What is the permission for a IAM user to create a ECR repository?

The required permission is AmazonEC2ContainerRegistryFullAccess
Caner's user avatar
  • 309
7 votes

Docker login to AWS ECR from GitLab CI fails with "dial tcp: lookup docker on x.x.x.x:53: no such host" when pulling docker:dind from ECR

When building docker image in gitlab-ci, you must add this (dind is for "docker in docker"): services: - docker:dind
Vincent J's user avatar
  • 173
6 votes
Accepted

How to choose between Elastic Container Service (ECS) or Elastic Container Registry (ECR), Elastic Beanstalk, and Lambda?

Elastic Beanstalk is your traditional hosting - you can upload a PHP or Java or whatever application, say Wordpress, configure a database, etc, and go. There are some smarts for scaling, recovery, etc,...
MLu's user avatar
  • 25.7k
6 votes

Configuring "auth" and "credsStore" for different Docker registry

Since docker 1.13.0 you can use the new credHelper format instead. I came here from Google having the exact same problem with credStore so thought I would add this for other to find. Example: $ cat ~/....
steevel's user avatar
  • 161
6 votes

Integrate Amazon Elastic Container Registry with Jenkins

This is now possible using amazon-ecr-credential-helper as described in https://aws.amazon.com/blogs/compute/authenticating-amazon-ecr-repositories-for-docker-cli-with-credential-helper/. The short ...
Klugscheißer's user avatar
5 votes

What is the permission for a IAM user to create a ECR repository?

I got this error some time back, notice that you have given "containerservicefullaccess" and not "ContainerRegistryFullAccess"
Ranjith's user avatar
  • 51
4 votes

What is the proper way to log in to ECR?

Assuming the AWS CLI is already configured correctly, for example with: aws configure Then just call the following: aws ecr get-login-password | docker login -u AWS --password-stdin "https://$(...
Druckles's user avatar
  • 143
3 votes

How to add amazon-ecr-credential-helper to path

Steps to set up Credential helper on Ubuntu. This assumes, you have docker installed and AWS credentials available at: ~/.aws/credentials file Clone the git repository https://github.com/...
Ravneet's user avatar
  • 31
2 votes

What is the proper way to log in to ECR?

The recommended way to log in to ECR is to use the command produced by aws ecr get-login.
User9123's user avatar
  • 121
2 votes

What is the proper way to log in to ECR?

$(aws ecr get-login --no-include-email --region cn-northwest-1) replace cn-northwest-1 as your region.
ola's user avatar
  • 21
2 votes

Podman fails pushing image to AWS ECR repository with: Error: writing blob: Post

The push command was failing as the specified repository never existed. ECR repository name: karlito96 Podman image:tag: git-pod:06 In both my tag and push commands the ECR path I chose didn't exist: ...
carlitobrigante's user avatar
1 vote

Docker login to AWS ECR from GitLab CI fails with "dial tcp: lookup docker on x.x.x.x:53: no such host" when pulling docker:dind from ECR

As mentioned by @orban https://serverfault.com/users/190624/orb%c3%a1n-zolt%c3%a1n Just add "privileged=true" to the /etc/gitlab-runner/config.toml for ex [runners.docker] tls_verify = ...
Faisal Affan's user avatar
1 vote

Docker login to AWS ECR from GitLab CI fails with "dial tcp: lookup docker on x.x.x.x:53: no such host" when pulling docker:dind from ECR

As per gitlab documentation when using a custom dind docker image the docker hostname is still expected. To fix this you need to add an alias in your gitlab CI config like so: build-push: stage: ...
scieslak's user avatar
  • 111
1 vote
Accepted

ECR Lifecycle Policy to exclude certain tags

ECR Lifecycle Policies are interesting in that their rules are processed in priority order, and that if one rule targets a set of images, subsequent rules will ignore those images. So for example, if ...
Zahav Capper's user avatar
1 vote
Accepted

Is it possible to have a failover/backup docker registry?

As of now, the docker engine has a --registry-mirror option, but that only works for configuring a mirror of Docker hub. There have been some open issues looking at whether or how that can be adjusted ...
BMitch's user avatar
  • 6,429
1 vote

How to choose between Elastic Container Service (ECS) or Elastic Container Registry (ECR), Elastic Beanstalk, and Lambda?

Adding to the previous answer - Elastic Beanstalk is more of a Pet platform while Docker (ECS) and Lambda are Cattles. That also means that Docker and Lambda are stateless which means they don't (must ...
KeepLearning's user avatar
1 vote

Amazon ECS Task fails with STOPPED (CannotPullContainerError: Error response from daem)

I solved this problem by removing and creating again ECR repository
Pavel Bernshtam's user avatar
1 vote
Accepted

Command Execution Error while executing ecr login command

Code Build Service Role automatically created in Code Pipeline was unable to access ECR, thats why i was getting exit status 255. Solved the issue by atttaching policy ...
Sreeraju V's user avatar
1 vote
Accepted

Docker login to AWS ECR fails with "dial tcp xxxx:443: i/o timeout"

I finally figured this out. What I didn't mention in this note is that I'm doing this in a VirtualBox VM. The only way this can work at all is if I connect without the corp firewall, using the ...
David M. Karr's user avatar
1 vote

Docker login to AWS ECR fails with "dial tcp xxxx:443: i/o timeout"

Did you reload systemd? systemctl daemon-reload You should be able to test once reloaded if your file is correct systemctl show --property Environment docker If so a docker restart should be ...
Mike's user avatar
  • 22.5k
1 vote

Automatically login on Amazon ECR with Docker Swarm

I had the same issue when using Docker Swarm and AWS auto-scaling enabled. Solution: You need to run the following command periodically on all services. docker service update -d -q --with-registry-...
sam ben's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible