for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

/var/lib/docker/tmp/docker-builderXXXXXXX/... no such file or directory

Open bjcatar opened this issue 9 years ago • 170 comments

Expected behavior

COPY command to copy a file from local to image

Actual behavior

doing a simple COPY command in Dockerfile is throwing this error when the file is in a folder (not same level as Dockerfile file)

Information

  • Full output of the diagnostics from "Diagnose & Feedback" in the menu

Docker for Mac: version: 17.06.0-ce-mac19 (4cdec4294a50b2233146b09469b49937dabdebdd) macOS: version 10.12.6 (build: 16G29) logs: /tmp/04FF32A9-CA64-40EB-B0DC-AD3E13A6C7D5/20170731-232145.tar.gz [OK] db.git [OK] vmnetd [OK] dns [OK] driver.amd64-linux [OK] virtualization VT-X [OK] app [OK] moby [OK] system [OK] moby-syslog [OK] db [OK] env [OK] virtualization kern.hv_support [OK] slirp [OK] osxfs [OK] moby-console [OK] logs [OK] docker-cli [OK] menubar [OK] disk

  • A reproducible case if this is a bug, Dockerfiles FTW See the following commands as a sample:

FROM python:latest RUN apt-get update RUN apt-get install nano RUN mkdir /code WORKDIR /code COPY /helpdesk/requirements.txt /code/

  • Page URL if this is a docs issue or the name of a man page

Steps to reproduce the behavior

  1. docker build -t test .

bjcatar avatar Aug 01 '17 03:08 bjcatar

I'm seeing the same problem with ADD in my Dockerfile as well

bggolding avatar Aug 03 '17 07:08 bggolding

Is there any news related to this issue? I had to downgrade to make it work. Today I upgraded and surprisingly it worked for a little bit, but soon it started failing again.

bjcatar avatar Aug 04 '17 01:08 bjcatar

I tried your example above and I changed the COPY line to:

COPY helpdesk/requirements.txt /code/

and made a helpdesk/requirements.txt in the directory next to the Dockerfile and I was able to build a docker image.

I'm not sure what the error message is trying to communicate but it is singularly unhelpful.

bggolding avatar Aug 07 '17 01:08 bggolding

it's definitely related to using a fully qualified path. if I put:

ADD /Volumes/dev/sterling/java-user-login-service/user-login-server/build/libs/user-login-server-1.0.5-SNAPSHOT.jar /user-login-server-1.0.5-SNAPSHOT.jar
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /user-login-server-1.0.5-SNAPSHOT.jar"]

then I get Step 1/2 : ADD /Volumes/dev/sterling/java-user-login-service/user-login-server/build/libs/user-login-server-1.0.5-SNAPSHOT.jar /user-login-server-1.0.5-SNAPSHOT.jar ADD failed: stat /var/lib/docker/tmp/docker-builder663214013/Volumes/dev/sterling/java-user-login-service/user-login-server/build/libs/user-login-server-1.0.5-SNAPSHOT.jar: no such file or directory

But if I change it to:

ADD build/libs/user-login-server-1.0.5-SNAPSHOT.jar /user-login-server-1.0.5-SNAPSHOT.jar
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /user-login-server-1.0.5-SNAPSHOT.jar"]

it all works

docker build -t mothra/user-service:1234 -f ./user-login-server/Dockerfile ./user-login-server
Sending build context to Docker daemon    363MB
Step 1/2 : ADD build/libs/user-login-server-1.0.5-SNAPSHOT.jar /user-login-server-1.0.5-SNAPSHOT.jar

chb0github avatar Aug 08 '17 23:08 chb0github

Fails on me, too. Worked with previous versions. Is this still present or any update avail? Which version do I have to revert to, to make this work again?

pbranforn avatar Aug 10 '17 10:08 pbranforn

This is happening to me too with simple case of

COPY content /app/

Any variations with ./content, /app produce the same error.

Note that I am seeing this problem both on CentOS and Ubuntu.

Gaibhne avatar Aug 10 '17 11:08 Gaibhne

I installed the edge version and I have been able to, for right now, continue to work.

Sent from my iPhone

On Aug 10, 2017, at 7:05 AM, Gaibhne [email protected] wrote:

This is happening to me too with simple case of

COPY content /app/

Any variations with ./content, /app produce the same error.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

bjcatar avatar Aug 10 '17 12:08 bjcatar

@bjcatar what is the version which resolved this?

puneetjindal avatar Aug 10 '17 13:08 puneetjindal

Ugh, as @Gaibhne pointed out, even a relative path such as COPY content /app or COPY ./content /app produces the same error.

Using Docker version 17.06.0-ce, build 02c1d87 in Ubuntu 16.04.3 LTS. Thoughts?

bsodmike avatar Aug 11 '17 00:08 bsodmike

@bjcatar Do please let us know which version you're running via docker version?

I've just removed my stable CE install and replaced with test, since edge is the same version as stable.

Client:                                                                       │
 Version:      17.07.0-ce-rc2                                                 │
 API version:  1.31                                                           │
 Go version:   go1.8.3                                                        │
 Git commit:   36ce605                                                        │
 Built:        Mon Aug  7 23:44:33 2017                                       │
 OS/Arch:      linux/amd64

I still get the same error though with 17.07.0-ce-rc2, build 36ce605 or 17.06.0-ce, build 02c1d87

bsodmike avatar Aug 11 '17 00:08 bsodmike

Ha, figured it out. Was attempting the build from the wrong path. /facepalm.

bsodmike avatar Aug 11 '17 01:08 bsodmike

@bsodmike Explain. What does your current file look like? I am trying to add with with full paths and it doesn't work

chb0github avatar Aug 11 '17 04:08 chb0github

I just had this problem, although I could copy some files and not others. Turned out that I had a parent directory excluded in .dockerignore and a directory I renamed was no longer being explicitly allowed.

jimschubert avatar Aug 11 '17 15:08 jimschubert

Also having the same issues on both stable & edge versions. I'm using the spotify/dockerfile-maven plugin and getting similar results and I don't have a .dockerignore file.

stewartmoreland avatar Aug 11 '17 20:08 stewartmoreland

Sorry about the late reply, was away from my mac the last few days. Here is the info for the version I now have that works:

Client: Version: 17.07.0-ce-rc1 API version: 1.31 Go version: go1.8.3 Git commit: 8c4be39 Built: Wed Jul 26 05:20:09 2017 OS/Arch: darwin/amd64

Server: Version: 17.07.0-ce-rc1 API version: 1.31 (minimum version 1.12) Go version: go1.8.3 Git commit: 8c4be39 Built: Wed Jul 26 05:25:01 2017 OS/Arch: linux/amd64 Experimental: true

On Aug 10, 2017, at 8:33 PM, Michael de Silva [email protected] wrote:

@bjcatar https://github.com/bjcatar Do please let us know which version you're running via docker version?

I've just removed my stable CE install and replaced with test, since edge is the same version as stable.

Client: │ Version: 17.07.0-ce-rc2 │ API version: 1.31 │ Go version: go1.8.3 │ Git commit: 36ce605 │ Built: Mon Aug 7 23:44:33 2017 │ OS/Arch: linux/amd64 I still get the same error though with 17.07.0-ce-rc2, build 36ce605 or 17.06.0-ce, build 02c1d87

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/docker/for-mac/issues/1922#issuecomment-321708500, or mute the thread https://github.com/notifications/unsubscribe-auth/AFSejO2pNkBSIUVhEGQN4HATGLsuG_doks5sW6FXgaJpZM4OpL3k.

bjcatar avatar Aug 12 '17 03:08 bjcatar

I'm seeing this on Docker for Windows 17.06.1-ce, build 874a737. ADD and COPY commands that worked before an update a few days ago now give errors like COPY failed: stat /var/lib/docker/tmp/docker-builder200899165/opt/julia: no such file or directory when I try to do something like COPY Make.user /opt/julia.

amellnik avatar Aug 25 '17 00:08 amellnik

I see this issue on Docker version 17.06.1-ce, build 874a737 too . The COPY failed following error COPY failed: stat /var/lib/docker/tmp/docker-builder426864723/build: no such file or directory

Does a downgrade to previous versions fix this?

dinesh-papineni avatar Aug 27 '17 05:08 dinesh-papineni

Confirming that I am facing similar issues with version 17.06.1-ce, build 874a737 on Sierra 10.12.6

COPY failed: stat /var/lib/docker/tmp/docker-builder384870922/build: no such file or directory

EDIT: same issue on edge version 17.07.0-ce-rc4, build fe143e3

matthieu-merlyn avatar Aug 30 '17 15:08 matthieu-merlyn

This question is because the .dockerignore file is excluded, so this is the result of the suggestion that "COPY failed: stat /var/lib/docker/tmp/docker-builder902282144/tag: no such file or directory"

Alternative: COPY failed: stat /var/lib/docker/tmp/docker-builder902282144/tag: no such file or directory, please check whether the dockerignore file has excluded, There may be aaa file rule excluded "

wpecker avatar Aug 31 '17 06:08 wpecker

RESOLUTION FOR ME -- the .dockerignore file was the culprit. It included a path that included my COPY src folder. Revising the .dockerignore resolved my issue.

RandyLarson avatar Sep 20 '17 13:09 RandyLarson