skip to Main Content

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:

  1. ctr

  2. crictl

  3. 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


  1. 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

    Login or Signup to reply.
  2. 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:

    aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | buildah login --username AWS --password-stdin ${REPO_URI}
    

    If you need provide K8s access to pull images from your ECR it’s another case and you can find documentation here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search