Score:0

Remove external Docker container registry dependencies / only store container images on Amazon ECR

my flag
A X

So I am using Amazon Elastic Container Registry (ECR) to store our containers. I have a container that is built using a Microsoft base image:

mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2016

What I am finding is that when I then push my container image to Amazon ECR, and then later I pull this image - it is STILL downloading the base layer from mcr.microsoft.com!

I am using Docker for Windows Server (not Docker for Linux).

I don't want this because mcr.microsoft.com is super slow and unreliable. Plus Microsoft keeps breaking the links by changing the names of the servers.

How do I get docker to NOT store an "external link" for the first layer to mcr.microsoft.com and instead store everything on Amazon ECR?

Score:1
nl flag

If you push an image to ECR you are no longer relying on the "first layer" of your dockerfile for the image you built. If you have a Dockerfile that has a FROM that points to mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2016 and you build an image off of this Dockerfile, you can push to ECR and you are no longer dependent on the mcr.

I am wondering if you are somehow still pulling from mcr in your docker pull syntax?

Your pull should have have a syntax along the lines of docker pull aws_account_id.dkr.ecr.us-west-2.amazonaws.com/my_image:my_tag and such a command won't depend on mcr

A X avatar
my flag
A X
Hmm this is what I thought but somehow it is still pulling the first layer from mcr and not amazon ecr. I am using the FROM command as you say above - is it possible that is somehow the reason? Is there a parameter in FROM to prevent this?
A X avatar
my flag
A X
Also please note this is Windows Server 2016 and not Linux
mreferre avatar
nl flag
The only way to pull from `mcr` would be at `docker build` time. Once you have built the container and pushed to ECR you are basically only pulling from ECR. How/where do you see it's still pulling from `mcr` when you pull from `ECR`? What does it make you say " it is still pulling the first layer from mcr and not amazon ecr"?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.