-
[AWS] lambda layer 업그레이드하기여러가지 공부 2025. 4. 28. 21:48
# create directory
mkdir fcm-push-dev-layer
# delete directory
rmdir fcm-initiation-layer
# create file and write
vim Dockerfile
# AWS Lambda Node.js 이미지 사용
FROM public.ecr.aws/lambda/nodejs:20
# 작업 디렉토리 설정
WORKDIR /layer
# 필요한 패키지 복사 및 설치
COPY package.json ./
RUN npm install
# Lambda 레이어 디렉토리 구조 생성
RUN mkdir -p nodejs && mv node_modules nodejs
# save and exit
:wq
# view
vi Dockerfile
# edit
i
# save
esc
# package.json file copy
cp /Users/honghayeon/dev/heymoon-infra/1.heymoon/modules/heymoon-infra/fcm-push-lambda-function-stage/package.json .
# Build the Docker image
docker build --platform linux/amd64 -t fcm-push-layer:latest .
# run
docker run --rm --platform linux/amd64 --entrypoint /bin/bash -v $(pwd):/output fcm-push-initiation-layer -c "cp -r /layer/nodejs /output/"
# zip
zip -r layer.zip nodejs
# docker container remove
docker rm fcm-push-dev-container
# docker image remove
docker rmi fcm-push-dev-layer
# 실행중인 컨테이너
docker ps
# 이미지
docekr images
반응형'여러가지 공부' 카테고리의 다른 글
[매크로] selenium 크롬드라이버 오류 해결 방법 (1) 2024.01.16 JWT는 무엇인가? (세션 방식과 차이, 구조, 작동 방식) (0) 2022.04.26 [클린코드] 주석 리팩토링 (0) 2021.08.31 [Android] Activity, Fragment 생명주기 (0) 2020.11.05 정규표현식 정리 (0) 2020.09.19