0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

AWS Lambdaで使用しているECRコンテナをローカルで確認する方法

Posted at

はじめに

Ubuntu環境です。

ローカルマシンに Runtime Interface Emulator をインストール

Lambda環境をローカルで再現してくれます。

mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \
https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \
&& chmod +x ~/.aws-lambda-rie/aws-lambda-rie     

コンテナの実行

IMAGE_URL=XXXXXXXXXXXXXXXXXXXX
IMAGE_HANDLER=app.handler # Lambda関数のコード内のハンドラー関数に応じて変更 DockerfileのCMDに指定したものと同じ
IMAGE_ENDPOINT=XXXXXXXXXXXXXXXXXXXX # Lambda関数のコード内のエンドポイントに応じて変更 DockerfileのENTRYPOINTに指定したものと同じ

docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \
  --entrypoint /aws-lambda/aws-lambda-rie \
  ${IMAGE_URL} \
  ${IMAGE_ENDPOINT} \
  ${IMAGE_HANDLER}

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?