9

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 '17 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 – Anthony Kong Jun 1 '17 at 23:15
9

The same pattern you use in docker push works:

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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.