One of the steps to log into ECR required to pull and push images is the following, according to AWS (https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html):
aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com
However, from starting from Kubernetes v1.24, Docker can no longer be used as a runtime.
In this case, if someone is using:
-
ctr
-
crictl
-
nerdctl
What does the login command become?
I have looked everyone but could not construct it. AWS doesn’t have documentation for it.
2
Answers
You do not have to change anything. Just keep your workflow with
docker login
with AWS ECR as usual.The reason is Kubernetes still supports Docker-produces images. It only deprecates Docker runtime in favor of runtimes that use the Container Runtime Interface (CRI) created for Kubernetes. For more information, please take a look at Don’t Panic: Kubernetes and Docker
What exactly are you trying to achieve?
If you are looking for a tool to build images inside K8s and push them to ECR, you can use
buildah
and auth to ECR by the command:If you need provide K8s access to pull images from your ECR it’s another case and you can find documentation here