moby: COPY / The system cannot find the file specified.
I can’t build image Always this error, and if I call docker-compose same.
docker build -t tagname .
Sending build context to Docker daemon 3.584kB
Step 1/6 : FROM microsoft/aspnetcore:2.0
---> 7789f525cb73
Step 2/6 : ARG source
---> Using cache
---> 9072545d21be
Step 3/6 : WORKDIR /app
---> Using cache
---> 1d8395c9a508
Step 4/6 : EXPOSE 80
---> Using cache
---> 748b65344910
**Step 5/6 : COPY ${source:-obj/Docker/publish} .
COPY failed: GetFileAttributesEx \\?\C:\Windows\TEMP\docker-builder460102490\obj\Docker\publish: The system cannot find the file specified.**
DockerFile
FROM microsoft/aspnetcore:2.0
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "docker-example.dll"]
docker version
Client:
Version: 17.06.2-ce
API version: 1.30
Go version: go1.8.3
Git commit: cec0b72
Built: Tue Sep 5 19:57:19 2017
OS/Arch: windows/amd64
Server:
Version: 17.06.2-ce
API version: 1.30 (minimum version 1.24)
Go version: go1.8.3
Git commit: cec0b72
Built: Tue Sep 5 19:59:47 2017
OS/Arch: windows/amd64
Experimental: true
docker version
Client:
Version: 17.06.2-ce
API version: 1.30
Go version: go1.8.3
Git commit: cec0b72
Built: Tue Sep 5 19:57:19 2017
OS/Arch: windows/amd64
Server:
Version: 17.06.2-ce
API version: 1.30 (minimum version 1.24)
Go version: go1.8.3
Git commit: cec0b72
Built: Tue Sep 5 19:59:47 2017
OS/Arch: windows/amd64
Experimental: true
D:\docker-example\docker-example>docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 5
Server Version: 17.06.2-ce
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: l2bridge l2tunnel nat null overlay transparent
Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 15063 (15063.0.amd64fre.rs2_release.170317-1834)
Operating System: Windows 10 Pro
OSType: windows
Architecture: x86_64
CPUs: 12
Total Memory: 15.95GiB
Name: A-STARKOU
ID: 5LPB:CED6:FAN5:OYGT:6GTO:ZA3T:F2XQ:DNIS:KAIJ:LXCI:S26L:DB3N
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: -1
Goroutines: 24
System Time: 2017-09-19T17:39:08.3799151+03:00
EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 23 (9 by maintainers)
It looks like this file was generated using the Visual Studio tools for Docker. These files are not very good and will only work when invoked from within Visual Studio (or you can figure out the right way to pass what I think is the
source
parameter.For a better approach, check out these resources: