【发布时间】:2018-11-21 06:24:19
【问题描述】:
我第一次尝试从已编译的 VS 项目的可执行文件中构建一个 docker 映像。我不希望 docker 构建我的项目(哦,不,考虑到我已经遇到的问题)。因此,我的应用程序源文件(和编译的二进制文件)所在的文件夹中有以下 Dockerfile:
位置:d:\MyApp
Dockerfile 内容:
FROM microsoft/windowsservercore
COPY bin /app
ENTRYPOINT ["C:\\app\\x86\\Debug\\MyApp.exe"]
MyApp 文件夹的内容:
MyApp\
MyApp\bin
MyApp\bin\x64
MyApp\bin\x64\Release
MyApp\bin\x64\Debug
MyApp\bin\x64\Release\* (lots of binaries)
MyApp\bin\x64\Debug\* (lots of binaries)
...
MyApp\Dockerfile
命令窗口:
d:\MyApp> docker image build .
Sending build context to Docker daemon 3.584kB
Step 1/3 : FROM microsoft/windowsservercore ---> 4dba31379dad
Step 2/3 : COPY bin /app COPY failed: CreateFile \\?\C:\ProgramData\Docker\tmp\docker-builder196938557\bin: The system cannot find the file specified.
如果我将 COPY 行更改为 COPY ./bin/*.* /app/ :
Sending build context to Docker daemon 3.584kB
Step 1/3 : FROM microsoft/windowsservercore
---> 4dba31379dad
Step 2/3 : COPY ./bin/*.* /app/
COPY failed: no source files were specified
【问题讨论】:
标签: docker dockerfile docker-image docker-for-windows