0

I need to build a docker image and need to copy a file from the different folder which don't have docker file

Basically this is my dir structure

C:\AGENT\_WORK\2
├───a
│   └───s
└───s
    └───Docker
            Dockerfile

so I need to copy all files from C:\AGENT\_WORK\2\a\s but my docker file is in C:\AGENT\_WORK\2\s\Docker\Dockerfile

I'm building the image by this command, I have given context as C:\agent_work`

docker build -t testapp:latest -f C:\AGENT\_WORK\2\s\Docker\Dockerfile C:\agent\_work

Dockerfile:

FROM mcr.microsoft.com/windows/nanoserver:1709 AS base
WORKDIR /app
ARG BINARY_SRC
EXPOSE 80
EXPOSE 443
ADD C:\AGENT\_WORK\2\a\s .
RUN ls
FROM base AS final
ENTRYPOINT ["dotnet", "TestApp.dll"]

Error:

ADD failed: CreateFile \?\C:\ProgramData\Docker\tmp\docker-builder076789264\agent_work: The system cannot find the path specified.

Sam
  • 471
  • 7
  • 24
  • If the context directory is the `agent_work` directory at the top of your directory tree, then any `ADD` and `COPY` directives are relative to that directory; so `COPY ./a/s .`. – David Maze Feb 21 '20 at 19:18
  • Nope its not working still getting the same error – Sam Feb 21 '20 at 19:34

0 Answers0