Dockerhub auto build fails, "not directory" when adding file

I am trying to use a docker hub to automatically create something that builds locally. He does not speak:

Build process failed: stat /var/lib/docker/aufs/mnt/1be9db483fa6f3de2596b5261e7c450de8df503185e579278396f14ba179c257/bin/run.sh: not a directory

Here you can view the assembly: https://hub.docker.com/r/zbyte64/rethinkdb-tlsproxy/builds/bjclhq33kgwxxvn6nbfsgyh/

run.sh is in the same directory as the Dockerfile , it seems that the build path on dockerhub is different from where it stores the Docker file.

I tried the following options:

COPY run.sh /bin

ADD ./run.sh /bin

+5
source share
3 answers

The COPY (in the Dockerhub version of Docker) expects the target file on the right side, not just the destination directory. The following command should work for you even on Dockerhub.

 COPY run.sh /bin/run.sh 
+4
source

Or, if you want to use ADD, specify the trailing slash. ADD ./run.sh /bin/

What is really going on? From https://docs.docker.com/engine/reference/builder/#add : ADD src dest "If dest does not end with a trailing slash, it will be considered a regular file and src will be written to dest."

Without a slash binding in / bin, it expects run.sh to be the directory copied to the / bin directory.

+1
source

I don't know why, but dockerhub wants the first COPY or ADD argument to be a directory, not a file. I am running Docker 1.9.1 locally and it is not. I switched Dockerfile to copy the resource directory instead of individual files, and everything began to work.

0
source

Source: https://habr.com/ru/post/1241769/


All Articles