2

I am using docker version 3, and .Net Core 2.0 web application.

This is my docker file:

FROM microsoft/aspnetcore:2.0
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "DotNetCoreWindowsTest.dll"]

and this is my docker-compose.yml file

version: '3'

    services:
      dotnetcorewindowstest:
        image: dotnetcorewindowstest
        build:
          context: ./DotNetCoreWindowsTest
          dockerfile: Dockerfile
        ports:
          - "3001:80"

I published my web application and from the published directory I run the command: docker-compose build and got the following error

ERROR: Service 'dotnetcorewindowstest' failed to build: 
COPY failed: stat /var/lib/docker/tmp/docker-builder739115341/obj/Docker/publish:
 no such file or directory

any ideas what is the problem?

1 Answer 1

3
COPY ${source:-obj/Docker/publish} .

The source seems to be pointing to /var/lib/docker/tmp/docker-builder739115341/. Try the using a relative path instead and copy it into a speficif folder to avoid conflicts with whatever is in the root filesystem.

Copy obj/Docker/publish /app
Sign up to request clarification or add additional context in comments.

2 Comments

changed to : Copy obj/Docker/publish . still getting same error
One more idea. could you try COPY obj/Docker/publish /app ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.