Docker - Getting error while trying to build image












0














I am new with docker, trying to create my first docker image/container with .net core console application in Windows 10, following the article https://www.c-sharpcorner.com/article/getting-started-with-docker-for-windows-containerize-a-c-sharp-console-app/



I am getting the error message when building image:



COPY /bin/Debug/netcoreapp2.0/publish/ . COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder989987487bin


The content of my Dockerfile:



FROM microsoft/dotnet:2.0.4-runtime-nanoserver-1709 AS base  

WORKDIR /app
COPY /bin/Debug/netcoreapp2.0/publish/ .

ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]



  • C:DotNetCoreConsoleApp1ConsoleApp1 is the root of my folder,
    where I palced above Dockerfile.


  • C:DotNetCoreConsoleApp1ConsoleApp1binDebugnetcoreapp2.1publish
    is the folder where content is get published by dotnet publish
    command.



Command used to create the image:



docker build -t alphaimage .









share|improve this question





























    0














    I am new with docker, trying to create my first docker image/container with .net core console application in Windows 10, following the article https://www.c-sharpcorner.com/article/getting-started-with-docker-for-windows-containerize-a-c-sharp-console-app/



    I am getting the error message when building image:



    COPY /bin/Debug/netcoreapp2.0/publish/ . COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder989987487bin


    The content of my Dockerfile:



    FROM microsoft/dotnet:2.0.4-runtime-nanoserver-1709 AS base  

    WORKDIR /app
    COPY /bin/Debug/netcoreapp2.0/publish/ .

    ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]



    • C:DotNetCoreConsoleApp1ConsoleApp1 is the root of my folder,
      where I palced above Dockerfile.


    • C:DotNetCoreConsoleApp1ConsoleApp1binDebugnetcoreapp2.1publish
      is the folder where content is get published by dotnet publish
      command.



    Command used to create the image:



    docker build -t alphaimage .









    share|improve this question



























      0












      0








      0







      I am new with docker, trying to create my first docker image/container with .net core console application in Windows 10, following the article https://www.c-sharpcorner.com/article/getting-started-with-docker-for-windows-containerize-a-c-sharp-console-app/



      I am getting the error message when building image:



      COPY /bin/Debug/netcoreapp2.0/publish/ . COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder989987487bin


      The content of my Dockerfile:



      FROM microsoft/dotnet:2.0.4-runtime-nanoserver-1709 AS base  

      WORKDIR /app
      COPY /bin/Debug/netcoreapp2.0/publish/ .

      ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]



      • C:DotNetCoreConsoleApp1ConsoleApp1 is the root of my folder,
        where I palced above Dockerfile.


      • C:DotNetCoreConsoleApp1ConsoleApp1binDebugnetcoreapp2.1publish
        is the folder where content is get published by dotnet publish
        command.



      Command used to create the image:



      docker build -t alphaimage .









      share|improve this question















      I am new with docker, trying to create my first docker image/container with .net core console application in Windows 10, following the article https://www.c-sharpcorner.com/article/getting-started-with-docker-for-windows-containerize-a-c-sharp-console-app/



      I am getting the error message when building image:



      COPY /bin/Debug/netcoreapp2.0/publish/ . COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder989987487bin


      The content of my Dockerfile:



      FROM microsoft/dotnet:2.0.4-runtime-nanoserver-1709 AS base  

      WORKDIR /app
      COPY /bin/Debug/netcoreapp2.0/publish/ .

      ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]



      • C:DotNetCoreConsoleApp1ConsoleApp1 is the root of my folder,
        where I palced above Dockerfile.


      • C:DotNetCoreConsoleApp1ConsoleApp1binDebugnetcoreapp2.1publish
        is the folder where content is get published by dotnet publish
        command.



      Command used to create the image:



      docker build -t alphaimage .






      docker .net-core window console-application






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 13:43

























      asked Nov 20 '18 at 8:40









      M_Idrees

      1,362927




      1,362927
























          1 Answer
          1






          active

          oldest

          votes


















          0














          You can try this, by removing the first / in the source directory of COPY:



          FROM microsoft/dotnet:2.0.4-runtime-nanoserver-1709 AS base  

          WORKDIR /app
          COPY bin/Debug/netcoreapp2.1/publish/ /app

          ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]





          share|improve this answer























          • Still getting same error COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder077812594binDebugnetcoreapp2.0publish: The system cannot find the path specified.
            – M_Idrees
            Nov 20 '18 at 10:42










          • I think docker is not able to find the folder
            – t-prisar
            Nov 20 '18 at 11:14










          • Yes, but how to make it find the right path
            – M_Idrees
            Nov 20 '18 at 11:14










          • you said that netcoreapp2.1 is the folder name after dotnet publish, but you are trying to copy from netcoreapp2.0
            – t-prisar
            Nov 20 '18 at 11:19










          • content is published to /bin/Debug/netcoreapp2.0/publish/ and COPY command is showing the same * bin/Debug/netcoreapp2.1/publish/*
            – M_Idrees
            Nov 20 '18 at 11:23











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389110%2fdocker-getting-error-while-trying-to-build-image%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You can try this, by removing the first / in the source directory of COPY:



          FROM microsoft/dotnet:2.0.4-runtime-nanoserver-1709 AS base  

          WORKDIR /app
          COPY bin/Debug/netcoreapp2.1/publish/ /app

          ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]





          share|improve this answer























          • Still getting same error COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder077812594binDebugnetcoreapp2.0publish: The system cannot find the path specified.
            – M_Idrees
            Nov 20 '18 at 10:42










          • I think docker is not able to find the folder
            – t-prisar
            Nov 20 '18 at 11:14










          • Yes, but how to make it find the right path
            – M_Idrees
            Nov 20 '18 at 11:14










          • you said that netcoreapp2.1 is the folder name after dotnet publish, but you are trying to copy from netcoreapp2.0
            – t-prisar
            Nov 20 '18 at 11:19










          • content is published to /bin/Debug/netcoreapp2.0/publish/ and COPY command is showing the same * bin/Debug/netcoreapp2.1/publish/*
            – M_Idrees
            Nov 20 '18 at 11:23
















          0














          You can try this, by removing the first / in the source directory of COPY:



          FROM microsoft/dotnet:2.0.4-runtime-nanoserver-1709 AS base  

          WORKDIR /app
          COPY bin/Debug/netcoreapp2.1/publish/ /app

          ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]





          share|improve this answer























          • Still getting same error COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder077812594binDebugnetcoreapp2.0publish: The system cannot find the path specified.
            – M_Idrees
            Nov 20 '18 at 10:42










          • I think docker is not able to find the folder
            – t-prisar
            Nov 20 '18 at 11:14










          • Yes, but how to make it find the right path
            – M_Idrees
            Nov 20 '18 at 11:14










          • you said that netcoreapp2.1 is the folder name after dotnet publish, but you are trying to copy from netcoreapp2.0
            – t-prisar
            Nov 20 '18 at 11:19










          • content is published to /bin/Debug/netcoreapp2.0/publish/ and COPY command is showing the same * bin/Debug/netcoreapp2.1/publish/*
            – M_Idrees
            Nov 20 '18 at 11:23














          0












          0








          0






          You can try this, by removing the first / in the source directory of COPY:



          FROM microsoft/dotnet:2.0.4-runtime-nanoserver-1709 AS base  

          WORKDIR /app
          COPY bin/Debug/netcoreapp2.1/publish/ /app

          ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]





          share|improve this answer














          You can try this, by removing the first / in the source directory of COPY:



          FROM microsoft/dotnet:2.0.4-runtime-nanoserver-1709 AS base  

          WORKDIR /app
          COPY bin/Debug/netcoreapp2.1/publish/ /app

          ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 20 '18 at 11:17

























          answered Nov 20 '18 at 10:25









          t-prisar

          6971619




          6971619












          • Still getting same error COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder077812594binDebugnetcoreapp2.0publish: The system cannot find the path specified.
            – M_Idrees
            Nov 20 '18 at 10:42










          • I think docker is not able to find the folder
            – t-prisar
            Nov 20 '18 at 11:14










          • Yes, but how to make it find the right path
            – M_Idrees
            Nov 20 '18 at 11:14










          • you said that netcoreapp2.1 is the folder name after dotnet publish, but you are trying to copy from netcoreapp2.0
            – t-prisar
            Nov 20 '18 at 11:19










          • content is published to /bin/Debug/netcoreapp2.0/publish/ and COPY command is showing the same * bin/Debug/netcoreapp2.1/publish/*
            – M_Idrees
            Nov 20 '18 at 11:23


















          • Still getting same error COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder077812594binDebugnetcoreapp2.0publish: The system cannot find the path specified.
            – M_Idrees
            Nov 20 '18 at 10:42










          • I think docker is not able to find the folder
            – t-prisar
            Nov 20 '18 at 11:14










          • Yes, but how to make it find the right path
            – M_Idrees
            Nov 20 '18 at 11:14










          • you said that netcoreapp2.1 is the folder name after dotnet publish, but you are trying to copy from netcoreapp2.0
            – t-prisar
            Nov 20 '18 at 11:19










          • content is published to /bin/Debug/netcoreapp2.0/publish/ and COPY command is showing the same * bin/Debug/netcoreapp2.1/publish/*
            – M_Idrees
            Nov 20 '18 at 11:23
















          Still getting same error COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder077812594binDebugnetcoreapp2.0publish: The system cannot find the path specified.
          – M_Idrees
          Nov 20 '18 at 10:42




          Still getting same error COPY failed: CreateFile \?C:ProgramDataDockertmpdocker-builder077812594binDebugnetcoreapp2.0publish: The system cannot find the path specified.
          – M_Idrees
          Nov 20 '18 at 10:42












          I think docker is not able to find the folder
          – t-prisar
          Nov 20 '18 at 11:14




          I think docker is not able to find the folder
          – t-prisar
          Nov 20 '18 at 11:14












          Yes, but how to make it find the right path
          – M_Idrees
          Nov 20 '18 at 11:14




          Yes, but how to make it find the right path
          – M_Idrees
          Nov 20 '18 at 11:14












          you said that netcoreapp2.1 is the folder name after dotnet publish, but you are trying to copy from netcoreapp2.0
          – t-prisar
          Nov 20 '18 at 11:19




          you said that netcoreapp2.1 is the folder name after dotnet publish, but you are trying to copy from netcoreapp2.0
          – t-prisar
          Nov 20 '18 at 11:19












          content is published to /bin/Debug/netcoreapp2.0/publish/ and COPY command is showing the same * bin/Debug/netcoreapp2.1/publish/*
          – M_Idrees
          Nov 20 '18 at 11:23




          content is published to /bin/Debug/netcoreapp2.0/publish/ and COPY command is showing the same * bin/Debug/netcoreapp2.1/publish/*
          – M_Idrees
          Nov 20 '18 at 11:23


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389110%2fdocker-getting-error-while-trying-to-build-image%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          Origin of the phrase “under your belt”?