title: DotNet build CLI works in terminal, but not in Docker build
body: <p>This is my first atempt with both .net core and docker. I cant figure out whats wrong. </p>
  
  <p>I can run <code>dotnet restore</code> / <code>dotnet build</code>  / <code>dotnet run</code> in the terminal without any problem. The site loads up just fine. So I wanted to give docker a try (eventually running on VM in the cloud). </p>
  
  <p>I run <code>docker build -t latest .</code> which results in:</p>
  
  <pre><code>Step 5 : RUN dotnet build
       ---&gt; Running in e463aff85460
      Project app (.NETCoreApp,Version=v1.0) will be compiled because project is not safe for incremental compilation. Use --build-profile flag for more information.
      Compiling app for .NETCoreApp,Version=v1.0
      /app/project.json(32,58): error NU1001: The dependency Microsoft.EntityFrameworkCore.Sqlite &gt;= 1.0.1 could not be resolved.
  
      Compilation failed.
          0 Warning(s)
          1 Error(s)
  
      Time elapsed 00:00:00.0174732
  
      The command 'dotnet build' returned a non-zero code: 1
  </code></pre>
  
  <p>I've tried changing the SQLite-version in project.json without any luck. </p>
  
  <p>NuGet repos:
  Feeds used:</p>
  
  <pre><code>https://www.myget.org/F/aspnetcirelease/api/v3/index.json
  
  https://api.nuget.org/v3/index.json
  
  dotnet --version
  1.0.0-preview3-003786
  </code></pre>
  
  <p>No edits to the dockerfile:</p>
  
  <pre><code>FROM microsoft/dotnet:latest
  
  COPY . /app
  
  WORKDIR /app
  
  RUN ["dotnet", "restore"]
  
  RUN ["dotnet", "build"]
  
  EXPOSE 5000/tcp
  
  CMD ["dotnet", "run", "--server.urls", "http://*:5000"]
  </code></pre>
  
  <p>Tried creating a .dockerignore after some Googling without any luck:</p>
  
  <pre><code>.git
  Dockerfile
  .DS_Store
  .gitignore
  README.md
  project.lock.json
  </code></pre>
  
  <p>Im on latest macOS (10.12).</p>
  
  <p>package.json:</p>
  
  <pre><code>{
    "dependencies": {
      "Microsoft.NETCore.App": {
        "version": "1.0.1",
        "type": "platform"
      },
      "Microsoft.AspNetCore.Diagnostics": "1.0.0",
      "Microsoft.AspNetCore.Mvc": "1.0.1",
      "Microsoft.AspNetCore.Razor.Tools": {
        "version": "1.0.0-preview2-final",
        "type": "build"
      },
      "Microsoft.AspNetCore.Routing": "1.0.1",
      "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
      "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
      "Microsoft.AspNetCore.StaticFiles": "1.0.0",
      "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
      "Microsoft.Extensions.Configuration.Json": "1.0.0",
      "Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
      "Microsoft.Extensions.Logging": "1.0.0",
      "Microsoft.Extensions.Logging.Console": "1.0.0",
      "Microsoft.Extensions.Logging.Debug": "1.0.0",
      "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
      "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
      "Microsoft.EntityFrameworkCore": "1.0.1",
      "Microsoft.EntityFrameworkCore.Design": {
        "version": "1.0.0-preview2-final",
        "type": "build"
      },
      "Microsoft.EntityFrameworkCore.Relational": "1.0.1",
      "Microsoft.EntityFrameworkCore.SQLite": "1.0.1",
      "Microsoft.EntityFrameworkCore.Sqlite.Design": "1.0.1"
    },
  
    "tools": {
      "BundlerMinifier.Core": "2.0.238",
      "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
      "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
      "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
    },
  
    "frameworks": {
      "netcoreapp1.0": {
        "imports": [
          "dotnet5.6",
          "portable-net45+win8"
        ]
      }
    },
  
    "buildOptions": {
      "emitEntryPoint": true,
      "preserveCompilationContext": true
    },
  
    "runtimeOptions": {
      "configProperties": {
        "System.GC.Server": true
      }
    },
  
    "publishOptions": {
      "include": [
        "wwwroot",
        "**/*.cshtml",
        "appsettings.json",
        "web.config"
      ]
    },
  
    "scripts": {
      "precompile": [ "dotnet bundle" ],
      "prepublish": [ "bower install" ],
      "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
    },
  
    "tooling": {
      "defaultNamespace": "MyFirstApp"
    }
  }
  </code></pre>
  
  <p>Output after trying to build docker container:</p>
  
  <pre><code>Sending build context to Docker daemon 26.39 MB
  Step 1 : FROM microsoft/dotnet:latest
   ---&gt; 96d122fe36cb
  Step 2 : WORKDIR /root
   ---&gt; Using cache
   ---&gt; 0c5317108a5b
  Step 3 : COPY bin/Debug/netcoreapp1.0/publish/ /root/
   ---&gt; Using cache
   ---&gt; d79700fa6c36
  Step 4 : ENTRYPOINT dotnet /root/MyProject.dll
   ---&gt; Using cache
   ---&gt; a99f30826ddd
  Successfully built a99f30826ddd
  </code></pre>