1

I'm creating a Dockerfile. I've included the unzipped protobuf-3.3.0 folder for Python in the same directory as the Dockerfile. There is a binary named configure in the protobuf folder that totally works on my (non-Docker) host.

I have the following lines in my Dockerfile:

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

However, this results in the following fatal error:

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

Why?!? According to this answer, what I have in my Dockerfile is exactly right. I also tried the version here, but the results were the same.

user124384
  • 400
  • 1
  • 9
  • 22

1 Answers1

4

What you have in your current folder is called context. It is available to your docker container to copy and work with, but it doesn't mean it there in your container.

You need to copy it in your dockerfile

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

WORKDIR only specifies what the current directory would be inside the container but doesn't copy that folder from context

Tarun Lalwani
  • 142,312
  • 9
  • 204
  • 265