在本地运行Docker lambda图像

时间:2017-10-03 22:54:22

标签: docker aws-lambda zappa

这是Dockerfile:

FROM lambci/lambda:build-python3.6

# Copy in your requirements file
ADD requirements.txt /requirements.txt

# Copy your application code to the container
RUN mkdir /code/
WORKDIR /code/
ADD . /code/

ENV PS1 'zappa@$(pwd | sed "s@^/var/task/\?@@")\$ '

ADD zappa_settings.json /var/task/zappa_settings.json

WORKDIR /var/task

RUN virtualenv /var/venv && \
    source /var/venv/bin/activate && \
    pip install -U pip zappa && \
    pip install -r /requirements.txt && \
    deactivate

CMD ["zappa"]

但是,当我运行docker-compose up时,我得到:

Recreating basesite_web_1 ...
Recreating basesite_web_1 ... error

ERROR: for basesite_web_1  Cannot start service web: oci runtime error: container_linux.go:262: starting container process caused "exec: \"zappa\": executable file not found in $PATH"


ERROR: for web  Cannot start service web: oci runtime error: container_linux.go:262: starting container process caused "exec: \"zappa\": executable file not found in $PATH"

ERROR: Encountered errors while bringing up the project.

我认为是因为我需要激活virtualenv。我希望能够在我的本地机器上运行该项目以进行开发。我错过了什么?谢谢!

0 个答案:

没有答案