I'm trying to build an image from the Dockerfile in which the script for installing the application is specified. Build perform:

docker build C:\docker 

Dockerfile example

 FROM debian:jessie COPY build.sh ./build.sh RUN chmod +x ./build.sh RUN ./build.sh 

When running "RUN ./build.sh" I get an error

/ bin / sh: 1: ./build.sh: not found

The command '/ bin / sh -c ./build.sh' returned a non-zero code: 127

If before this line to display the contents of the directory, the build.sh is there, and chmod is executed without error.

The script itself is simple:

 #!/bin/bash set -e apt-get update 

What could be causing this error?

  • all the same he is not there - Senior Pomidor
  • perhaps in build.sh there is a utility that is not in the image. show that in build.sh - Senior Pomidor
  • @SeniorPomidor Completed the question. Because This is my acquaintance with the docker, the script is incredibly simple. If I specify RUN apt-get update in Dockerfile, then everything is done - UserName
  • I have done your example. I build successfully. try to keep Dockerfile and build.sh nearby. go to the Dockerfile directory and run docker build -t test . - Senior Pomidor
  • @SeniorPomidor Dockerfile and build.sh in one directory, no more. Doing "docker build -t test." the same error ( - UserName

0