2017-08-13 109 views
0

我正在创建一个Dockerfile。我已经将Python解压缩后的protobuf-3.3.0文件夹包含在与Dockerfile相同的目录中。 protobuf文件夹中有一个名为configure的二进制文件,完全适用于我的(非Docker)主机。Docker找不到配置文件

我在Dockerfile下面几行:

WORKDIR /protobuf-3.3.0 
RUN ./configure && make && make install 

然而,这将导致以下致命错误:

Step 4/13 : WORKDIR protobuf-3.3.0 
---> 077ec08916d7 
Removing intermediate container 50647f3aa6d7 
Step 5/13 : RUN ./configure && make && make install 
---> Running in 2d6f8446cdd9 
/bin/sh: 1: ./configure: not found 

为什么?!?据this answer,我在我的Dockerfile中是完全正确的。我也试过版本here,但结果是一样的。

+0

显示整个Dockerfile – user2915097

回答

2

你在当前文件夹中有什么称为上下文。它可供您的码头集装箱复制和使用,但并不意味着它在您的集装箱中。

你需要在你的dockerfile复制

WORKDIR /protobuf-3.3.0 
COPY ./protobuf-3.3.0 /protobuf-3.3.0 
RUN ./configure && make && make install 

WORKDIR仅指定当前目录将是容器内什么,但并没有该文件夹的情况下复制

+0

OMG是你是认真的?这太可笑了。谢谢,这工作! – user124384