ABOUT ME

Contact.
Email:yj.anthonyjo@gmail.com
Introduce : CS Student.

Today
-
Yesterday
-
Total
-
  • AWS - Lambda with docker image, LAMBDA_TASK_ROOT
    카테고리 없음 2022. 11. 15. 04:11
    반응형
    FROM public.ecr.aws/lambda/python:3.8
    
    # Copy function code
    COPY app.py ${LAMBDA_TASK_ROOT}
    
    # Install the function's dependencies using file requirements.txt
    # from your project folder.
    
    COPY requirements.txt  .
    RUN  pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"
    
    # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
    CMD [ "app.handler" ]

    docker file을 위와 같이 짜라고 조언한다.

    LAMBDA_TASK_ROOT는 무엇인가?

    환경변수 같다.

    그렇다. /var/task를 기본 값으로 가지고 있다.

    https://peanut159357.tistory.com/106

     

    다만 한가지 의문이 든다.

    base image에서 기본으로 정의하는 환경변수를 도커파일에서 사용할 수 있는 것인가?

    -> 추가로 알아볼 부분이다.

     

    ------

    추가-lambda 기본 환경변수들

    https://docs.aws.amazon.com/ko_kr/lambda/latest/dg/configuration-envvars.html

     

    반응형

    댓글

Designed by Tistory.