Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pull AWS Lambda container image

I'm trying to run a Docker container on AWS Lambda. Specifically I'm following this official tutorial

I have the following Dockerfile

FROM public.ecr.aws/lambda/nodejs:12

COPY app app.js package.json /var/task/
RUN npm install

CMD [ "app.handler" ]

But, when I try to build this I get the following error:

docker build -t hello-world .

Sending build context to Docker daemon  4.608kB
Step 1/4 : FROM public.ecr.aws/lambda/nodejs:12
pull access denied for public.ecr.aws/lambda/nodejs, repository does not exist or may require 'docker login': denied: Your authorization token has expired. Reauthenticate and try again.

When I login with docker login command I still get the same error.

Does anyone know how to resolve this?

like image 960
Dirk Hoekstra Avatar asked Mar 03 '26 00:03

Dirk Hoekstra


1 Answers

Works fine here. You shouldn't need credentials for Public ECR (you can use auth for specific cases) but if you just want to consume it, remove the existing credentials

docker logout public.ecr.aws

and then try the build again.

That said, if you still want to make use of the authentication, you need to re-auth as described in the doc

aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
like image 102
Sathyajith Bhat Avatar answered Mar 04 '26 18:03

Sathyajith Bhat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!