【发布时间】:2020-01-07 11:48:22
【问题描述】:
我在 AWS lambda 上成功使用了 Pychromeless repo。
但现在我需要使用 pycrypto 依赖,但我得到了
configure: error: no acceptable C compiler found in $PATH
运行时make docker-build
(将pycrypto==2.6.1 放在requirements.txt 文件之后)。
有this thread 有人说同样的问题:
“gcc 编译器不在您的 $PATH 中。这意味着您没有安装 gcc 或者它不在您的 $PATH 变量中”。
所以尝试将apt-get install build-essential 放在 Dockerfile 中,但我得到了
/bin/sh: apt-get: command not found
然后,我尝试使用yum install gcc
只为得到
The command '/bin/sh -c yum install gcc' returned a non-zero code: 1
Docker-lambda [信息页面] (https://hub.docker.com/r/lambci/lambda/) 说:
This project consists of a set of Docker images for each of the supported Lambda runtimes.
There are also a set of build images that include packages like gcc-c++, git, zip and the aws-cli for compiling and deploying.
所以我想我不需要安装 gcc。可能 gcc 编译器不在 $PATH 中,但我不知道如何解决这个问题。
这里是 dockerfile
FROM lambci/lambda:python3.6
MAINTAINER tech@21buttons.com
USER root
ENV APP_DIR /var/task
WORKDIR $APP_DIR
COPY requirements.txt .
COPY bin ./bin
COPY lib ./lib
RUN mkdir -p $APP_DIR/lib
RUN pip3 install -r requirements.txt -t /var/task/lib
对解决这个问题有帮助吗?
【问题讨论】:
-
RUN yum update -y && yum install -y gcc安装gcc。 -
@masseyb:同样的答案:
Service 'lambda' failed to build: The command '/bin/sh -c yum update -y && yum install -y gcc' returned a non-zero code: 1 -
那张lambci/lambda 图像基于什么?它是由什么构成的?
-
他们说:
There are also a set of build images that include packages like gcc-c++, git, zip and the aws-cli for compiling and deploying.
标签: python-3.x docker dockerfile pycrypto