Title: Build context scan feels slow when directory contains large file tree · Issue #1409 · docker-java/docker-java · GitHub
Open Graph Title: Build context scan feels slow when directory contains large file tree · Issue #1409 · docker-java/docker-java
X Title: Build context scan feels slow when directory contains large file tree · Issue #1409 · docker-java/docker-java
Description: Environment: IntelliJ IDEA 2020.2 EAP Build #IU-202.5103.13 with bundled Docker plugin 202.5103.13. Docker plugin must use docker-java, connection to Docker Desktop for Windows via npipe. Cannot find out the exact version of docker-java ...
Open Graph Description: Environment: IntelliJ IDEA 2020.2 EAP Build #IU-202.5103.13 with bundled Docker plugin 202.5103.13. Docker plugin must use docker-java, connection to Docker Desktop for Windows via npipe. Cannot fi...
X Description: Environment: IntelliJ IDEA 2020.2 EAP Build #IU-202.5103.13 with bundled Docker plugin 202.5103.13. Docker plugin must use docker-java, connection to Docker Desktop for Windows via npipe. Cannot fi...
Opengraph URL: https://github.com/docker-java/docker-java/issues/1409
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Build context scan feels slow when directory contains large file tree","articleBody":"Environment: IntelliJ IDEA 2020.2 EAP Build #IU-202.5103.13 with bundled Docker plugin 202.5103.13. Docker plugin must use docker-java, connection to Docker Desktop for Windows via npipe. Cannot find out the exact version of docker-java that is used.\r\n\r\nGiven the following minimal project setup:\r\n`node_modules` with +67k files\r\n`Dockerfile` with single line `FROM hello-world` \r\n`.dockerignore` with single line `node_modules`\r\n\r\nThen, run `docker build .` in the root directory.\r\n\r\nExpected behaviour: The image is built instantly, because build context contains only the Dockerfile (large node_modules directory is ignored), and there are almost no instructions in the Dockerfile itself.\r\n\r\nObserved behaviour: For +30 seconds, the screen shows \"Building image...\" , and after that only one file is added to the build context archive.\r\n\r\nI assume, the build traverses all +67k files in the node_modules directory, only to find none of them have to be included. This would be very inefficient. When there are no exceptions, that allow a file below node_modules, it might skip the whole directory.\r\n\r\nUpdate:\r\nUnit test in `docker-java-core`, `testdir` has the large folder as child, `.dockerignore` absent:\r\n```java\r\n@Test\r\n public void can_parse_dockerfile() throws IOException {\r\n File dockerFile = new File(\".\\\\testdir\\\\Dockerfile\");\r\n File baseDirectory = new File(\".\\\\testdir\");\r\n Dockerfile dockerfile = new Dockerfile(dockerFile, baseDirectory);\r\n Stopwatch stopwatch = Stopwatch.createStarted();\r\n Dockerfile.ScannedResult parse = dockerfile.parse();\r\n System.out.println(\"Parse took \" + stopwatch.elapsed(TimeUnit.MILLISECONDS) + \"ms\");\r\n System.out.println(parse.filesToAdd.size() + \" files added\");\r\n }\r\n```\r\nOutput:\r\n\u003e Parse took 28008ms\r\n\u003e 4 files added","author":{"url":"https://github.com/swiedenfeld","@type":"Person","name":"swiedenfeld"},"datePublished":"2020-06-07T20:43:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/1409/docker-java/issues/1409"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a4f32211-0cc4-8f31-765c-1b92f1b9d92a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A754:2EEAE2:44021CA:5E9A61B:69714822 |
| html-safe-nonce | ff49f4cecaf692023578bf46789f7075855690ff6879029cf3e8a2f561129b3a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzU0OjJFRUFFMjo0NDAyMUNBOjVFOUE2MUI6Njk3MTQ4MjIiLCJ2aXNpdG9yX2lkIjoiMzc1MTQ0MDc3NTU5ODEzMTIzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d74178430f3d35eff6d70866c37d605b232891545d46645e1d5155b47cfb546b |
| hovercard-subject-tag | issue:633746614 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/docker-java/docker-java/1409/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a57dce3446bbb58cf23ceee58a246c8e96cb2f036bd57e9aa82837e5917b57ba/docker-java/docker-java/issues/1409 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a57dce3446bbb58cf23ceee58a246c8e96cb2f036bd57e9aa82837e5917b57ba/docker-java/docker-java/issues/1409 |
| og:image:alt | Environment: IntelliJ IDEA 2020.2 EAP Build #IU-202.5103.13 with bundled Docker plugin 202.5103.13. Docker plugin must use docker-java, connection to Docker Desktop for Windows via npipe. Cannot fi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | swiedenfeld |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9bd14a55b65b030988a89787ed340c0f040258c3240af6941d85f740f21629a0 |
| turbo-cache-control | no-preview |
| go-import | github.com/docker-java/docker-java git https://github.com/docker-java/docker-java.git |
| octolytics-dimension-user_id | 7772003 |
| octolytics-dimension-user_login | docker-java |
| octolytics-dimension-repository_id | 20415251 |
| octolytics-dimension-repository_nwo | docker-java/docker-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20415251 |
| octolytics-dimension-repository_network_root_nwo | docker-java/docker-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 24a7109a3a584a05e29240fcc1ba60220deccdb8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width