In a typical dockerfile, there is usually this line From ubuntu:16.04 which enables pulling an image from docker repository.

Now I have built my own image repository:

enter image description here

The repositiory URI is: 1234567890.dkr.ecr.us-west-2.amazonaws.com/mycompany

As seen in the above screenshot, I pushed an image to the server.

I run the following to ensure I have login to the ecr

> `aws ecr get-login --region us-west-2`
Flag --email has been deprecated, will be removed in 1.14.
Login Succeeded

ECR login completes without error. Then I tried to build a new image:

> docker build -t rtf-converter . -f Dockerfile-rtf-converter 
Sending build context to Docker daemon 790.1 MB
Step 1/2 : FROM mycompany:latest
repository mycompany not found: does not exist or no pull access

Here is the content of the Dockerfile

FROM mycompany:latest
RUN apt-get install chef-zero

What is the right way to specify the repository properly in the FROM statement?

I am particularly confused by labels. What is a good convention of labeling?

  • It's just a docker registry, so yes. Just make sure dockerd is authenticated with the ECR repo properly.
    – EEAA
    Jun 1, 2017 at 23:11
  • I see. I have tried asw ecr login but still fail. I will revise the question to address this problem. I hope you don't mind I shift the goal poles Jun 1, 2017 at 23:15
  • using the example above i wonder how/where to specify AWS credential? FROM 1234567890.dkr.ecr.us-west-2.amazonaws.com/mycompany:latest
    – alvin
    Apr 6, 2022 at 15:33

1 Answer 1


The same pattern you use in docker push works:

FROM 1234567890.dkr.ecr.us-west-2.amazonaws.com/mycompany:latest

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .