Fail to add files within a Dockerfile

Thomas Boerger's Avatar

Thomas Boerger

08 Jan, 2018 11:42 AM

We try to add built binaries within a Dockerfile, like this:

```
ADD drone-matrix.exe /drone-matrix.exe
```

But for the last builds the execution of `docker build -f Dockerfile.windows -t plugins/matrix:windows .` fails hard with an error like this:

```
Sending build context to Docker daemon 3.072kB
Step 1/4 : FROM microsoft/nanoserver:10.0.14393.1593
 ---> 28dad12ef0bc
Step 2/4 : LABEL maintainer "Drone.IO Community <[email blocked]>" org.label-schema.name "Drone Matrix" org.label-schema.vendor "Drone.IO Community" org.label-schema.schema-version "1.0"
 ---> Running in bd7e376d0834
 ---> 4bcebabbebc4
Removing intermediate container bd7e376d0834
Step 3/4 : ADD drone-matrix.exe /drone-matrix.exe
docker : ADD failed: GetFileAttributesEx \\?\C:\Windows\TEMP\docker-builder566940906\drone-matrix.exe: The system cannot find the file specified.
At line:11 char:1
+ docker build -f Dockerfile.windows -t plugins/matrix:windows .
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (ADD failed: Get...file specified.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
Command executed with exception: ADD failed: GetFileAttributesEx \\?\C:\Windows\TEMP\docker-builder566940906\drone-matrix.exe: The system cannot find the file specified.
```

Had there been some update the changed the Docker workspace? What is the proper way now to add files from the build directory to the Docker context?

  1. 1 Posted by Thomas Boerger on 08 Jan, 2018 11:43 AM

    Thomas Boerger's Avatar

    Just to reference a specific failing build: https://ci.appveyor.com/project/tboerger/drone-matrix/build/3

  2. 2 Posted by appleboy.tw on 08 Jan, 2018 02:00 PM

    appleboy.tw's Avatar
  3. 3 Posted by Thomas Boerger on 09 Jan, 2018 10:33 AM

    Thomas Boerger's Avatar

    The strange thing is that different project with the same configuration and only a different file name are working fine.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac