{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/dotnet-docker/issues/566","repository_url":"https://api.github.com/repos/dotnet/dotnet-docker","labels_url":"https://api.github.com/repos/dotnet/dotnet-docker/issues/566/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/dotnet-docker/issues/566/comments","events_url":"https://api.github.com/repos/dotnet/dotnet-docker/issues/566/events","html_url":"https://github.com/dotnet/dotnet-docker/issues/566","id":328793536,"node_id":"MDU6SXNzdWUzMjg3OTM1MzY=","number":566,"title":"Remove unncessessary ASP.NET Core 2.1 Dockerfile step 'RUN dotnet restore'","user":{"login":"Andrioden","id":393376,"node_id":"MDQ6VXNlcjM5MzM3Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/393376?v=4","gravatar_id":"","url":"https://api.github.com/users/Andrioden","html_url":"https://github.com/Andrioden","followers_url":"https://api.github.com/users/Andrioden/followers","following_url":"https://api.github.com/users/Andrioden/following{/other_user}","gists_url":"https://api.github.com/users/Andrioden/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrioden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrioden/subscriptions","organizations_url":"https://api.github.com/users/Andrioden/orgs","repos_url":"https://api.github.com/users/Andrioden/repos","events_url":"https://api.github.com/users/Andrioden/events{/privacy}","received_events_url":"https://api.github.com/users/Andrioden/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-03T02:35:07Z","updated_at":"2018-06-04T16:00:47Z","closed_at":"2018-06-04T16:00:47Z","author_association":"NONE","body":"[ASP.NET Core 2.1 sample Dockerfile](https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/Dockerfile) has a uneccessary step, that also fails for other solution projects added to the solution, like a test project.\r\n\r\n`RUN dotnet restore`\r\n\r\ndotnet restore documentation states:\r\n> [Starting with .NET Core 2.0, you don't have to run dotnet restore because it's run implicitly by all commands that require a restore to occur, such as dotnet new, dotnet build and dotnet run](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-restore?tabs=netcore2x)\r\n\r\nIt is uncessessary because a publish/build command is later run, obviously.  : P\r\n\r\nIt fails for other projects because they have not been copied to the ./aspnetapp/ folder. You might think; \"but add the other project with Copy\", no, one does not always want to do so! Like for test projects which should not be built as part of the Dockerimage. Instead i want to only build the actual deployed aspnetapp.dll.\r\n\r\nBy removing the \"RUN dotnet restore\" step we make sure only the neccessary projects is restored."},"comment":{"url":"https://api.github.com/repos/dotnet/dotnet-docker/issues/comments/394408090","html_url":"https://github.com/dotnet/dotnet-docker/issues/566#issuecomment-394408090","issue_url":"https://api.github.com/repos/dotnet/dotnet-docker/issues/566","id":394408090,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDQwODA5MA==","user":{"login":"Andrioden","id":393376,"node_id":"MDQ6VXNlcjM5MzM3Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/393376?v=4","gravatar_id":"","url":"https://api.github.com/users/Andrioden","html_url":"https://github.com/Andrioden","followers_url":"https://api.github.com/users/Andrioden/followers","following_url":"https://api.github.com/users/Andrioden/following{/other_user}","gists_url":"https://api.github.com/users/Andrioden/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrioden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrioden/subscriptions","organizations_url":"https://api.github.com/users/Andrioden/orgs","repos_url":"https://api.github.com/users/Andrioden/repos","events_url":"https://api.github.com/users/Andrioden/events{/privacy}","received_events_url":"https://api.github.com/users/Andrioden/received_events","type":"User","site_admin":false},"created_at":"2018-06-04T16:00:47Z","updated_at":"2018-06-04T16:00:47Z","author_association":"NONE","body":"@MichaelSimons - Thank you for this detailed answer, I did not know that the build cache corresponds to each instruction! I am changing my code and closing this issue."}}
{"actor":{"display_login":"Andrioden"}}