Title: Dockerfile best practices to speed up builds by aidansteele · Pull Request #243 · aspnet/JavaScriptServices · GitHub
Open Graph Title: Dockerfile best practices to speed up builds by aidansteele · Pull Request #243 · aspnet/JavaScriptServices
X Title: Dockerfile best practices to speed up builds by aidansteele · Pull Request #243 · aspnet/JavaScriptServices
Description: I noticed that there was some room for improvement in the Dockerfiles created by the Yeomen generator. There are two parts to it: Run the apt-get commands before any project-specific commands. Copy only project.json before running dotnet restore, then copy the rest before dotnet build. The rationale for both these changes is driven by how Docker caches intermediate images in building from a Dockerfile. I won't duplicate that explanation here, but this means that Node.js won't need to be reinstalled on every code change and project dependencies won't need to be restored unless project.json changes. I hope you find this useful. I wouldn't have been able to get started down the ASP.Net SPA path without the generators, so keep up the great work. EDIT: I would have also added a .dockerignore to the templates, but I'm not at all familiar with Yeomen generators and wasn't sure if it was as simple as dropping it in the right place. It's essentially the same syntax as the .gitignore. We don't want any build artifacts from the Docker host making their way into the Docker container.
Open Graph Description: I noticed that there was some room for improvement in the Dockerfiles created by the Yeomen generator. There are two parts to it: Run the apt-get commands before any project-specific commands. Cop...
X Description: I noticed that there was some room for improvement in the Dockerfiles created by the Yeomen generator. There are two parts to it: Run the apt-get commands before any project-specific commands. Cop...
Opengraph URL: https://github.com/aspnet/JavaScriptServices/pull/243
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:dcc0f6e2-8cad-dbb1-248e-ffbdd5c5391a |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 888C:25BF4B:2173FBD:2D15743:6972B73E |
| html-safe-nonce | 8d1f02c9d276b40494c33a497784c59cd22007de2deb351b0700de44398baefe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODhDOjI1QkY0QjoyMTczRkJEOjJEMTU3NDM6Njk3MkI3M0UiLCJ2aXNpdG9yX2lkIjoiODM1MDY0NzE0ODA3MTc5NDQ5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e558e3ded67286757b73ca0ea30b9edef0577f6fde122b769fed8104c9d84cd0 |
| hovercard-subject-tag | pull_request:80007755 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/aspnet/JavaScriptServices/pull/243/checks |
| twitter:image | https://avatars.githubusercontent.com/u/369053?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/369053?s=400&v=4 |
| og:image:alt | I noticed that there was some room for improvement in the Dockerfiles created by the Yeomen generator. There are two parts to it: Run the apt-get commands before any project-specific commands. Cop... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 51c0d0848f5569c6fa2198e9d69bd5f8f94a83c9fa3659e40728e7732afab130 |
| turbo-cache-control | no-preview |
| go-import | github.com/aspnet/JavaScriptServices git https://github.com/aspnet/JavaScriptServices.git |
| octolytics-dimension-user_id | 6476660 |
| octolytics-dimension-user_login | aspnet |
| octolytics-dimension-repository_id | 45365298 |
| octolytics-dimension-repository_nwo | aspnet/JavaScriptServices |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45365298 |
| octolytics-dimension-repository_network_root_nwo | aspnet/JavaScriptServices |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 10c5e2f2307495b2750073db87e9a5d3356a924f |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width