{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/13617","labels_url":"https://api.github.com/repos/docker/docker/issues/13617/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/13617/comments","events_url":"https://api.github.com/repos/docker/docker/issues/13617/events","html_url":"https://github.com/docker/docker/pull/13617","id":82946722,"number":13617,"title":"Windows: Statically linkable SQLite3","user":{"login":"jhowardmsft","id":10522484,"avatar_url":"https://avatars.githubusercontent.com/u/10522484?v=3","gravatar_id":"","url":"https://api.github.com/users/jhowardmsft","html_url":"https://github.com/jhowardmsft","followers_url":"https://api.github.com/users/jhowardmsft/followers","following_url":"https://api.github.com/users/jhowardmsft/following{/other_user}","gists_url":"https://api.github.com/users/jhowardmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/jhowardmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhowardmsft/subscriptions","organizations_url":"https://api.github.com/users/jhowardmsft/orgs","repos_url":"https://api.github.com/users/jhowardmsft/repos","events_url":"https://api.github.com/users/jhowardmsft/events{/privacy}","received_events_url":"https://api.github.com/users/jhowardmsft/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/group/windows","name":"group/windows","color":"D6EBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/status/2-code-review","name":"status/2-code-review","color":"fad8c7"}],"state":"open","locked":false,"assignee":{"login":"crosbymichael","id":749551,"avatar_url":"https://avatars.githubusercontent.com/u/749551?v=3","gravatar_id":"","url":"https://api.github.com/users/crosbymichael","html_url":"https://github.com/crosbymichael","followers_url":"https://api.github.com/users/crosbymichael/followers","following_url":"https://api.github.com/users/crosbymichael/following{/other_user}","gists_url":"https://api.github.com/users/crosbymichael/gists{/gist_id}","starred_url":"https://api.github.com/users/crosbymichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosbymichael/subscriptions","organizations_url":"https://api.github.com/users/crosbymichael/orgs","repos_url":"https://api.github.com/users/crosbymichael/repos","events_url":"https://api.github.com/users/crosbymichael/events{/privacy}","received_events_url":"https://api.github.com/users/crosbymichael/received_events","type":"User","site_admin":false},"milestone":null,"comments":52,"created_at":"2015-05-30T23:46:16Z","updated_at":"2015-07-21T02:33:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/13617","html_url":"https://github.com/docker/docker/pull/13617","diff_url":"https://github.com/docker/docker/pull/13617.diff","patch_url":"https://github.com/docker/docker/pull/13617.patch"},"body":"Signed-off-by: John Howard <jhoward@microsoft.com>\r\n\r\nThis PR is part of the proposal described in docker/docker issue 10662 to port the docker daemon to Windows.\r\n\r\nI’m re-introducing this PR for adding a Windows-specific SQL driver as a separate issue, not intermingled with other changes as it was previously (PR #13001). I appreciate previous discussions about it being a less than ideal solution. After conversations with @icecrime and other docker folks, plus on IRC, and having done further due diligence, at this current point in time this is the only suitable solution for the Windows daemon. \r\n\r\n## Why does Windows need this?\r\n\r\n- Docker daemon as it currently stands has a dependency on a SQL database (linkgraph.db). \r\n\r\n- We want a single docker.exe without shipping additional binaries (sqlite3.dll) to reduce customer problems, particularly those just using docker as a client, not as a daemon. (remember it’s the same docker.exe for both client and server use)\r\n\r\n- It is not possible to static link sqlite3.dll into docker.exe in go. There are hundreds of reports on the Internet of static linking of sqlite3 being a problem on Windows when using golang. The only reliable solution reported has been to use this alternate driver.\r\n\r\n- We want a daemon that can cross-compile successfully (although ultimately this might change to native)\r\n\r\n## Suggestions made to date:\r\n\r\n1.\tUse QL, a native go database driver.\r\nI looked into this and had a prototype limping. However, QL has many limitations and is not mature enough to even support the constraints in the current linkgraph database. There were other limitations too, happy to point folks to the prototype branch and go into more details as to why it is unworkable at the current level of maturity.\r\n\r\n2.\tEmbed sqlite3.dll as a resource. \r\nThis would involve embedding it in the binary, extracting at runtime and doing lazy rather than static calling. This was looked at. However, the additional complexity was (is) a 9 out of 10 on the level of crazy, and fraught with potential points of failure, hence realistically deemed unviable.\r\n\r\n3.\tRemove SQL all together. \r\nThis is way beyond the remit of immediately getting the docker daemon running on the mainline docker/docker codebase. It bypasses the problem rather than addressing what is a very real problem today.\r\n\r\nSo the net result from above is we still have an issue in the Windows daemon bring up.\r\n\r\n## Counter-argument:\r\n\r\nThere should not be two SQL drivers. Either \r\n-\tmake the Windows one use the existing driver, or \r\n-\tmake Linux use the new driver. \r\nWell we've already ascertained that Windows can't use the Linux one and statically link. So could Linux use the new driver? Short answer is probably not as certain Linux distros (apologies can't recall which one was brought up specifically on IRC) want to patch sqlite3 independently. Unfortunately this new driver embeds the amalgamation sources in it, so that makes separate patching impossible.\r\n\r\nHence at this point, this is the only solution on the table for the Windows daemon (and incidentally what we used for the //build proof-of-concept demos).\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/123132087","html_url":"https://github.com/docker/docker/pull/13617#issuecomment-123132087","issue_url":"https://api.github.com/repos/docker/docker/issues/13617","id":123132087,"user":{"login":"jhowardmsft","id":10522484,"avatar_url":"https://avatars.githubusercontent.com/u/10522484?v=3","gravatar_id":"","url":"https://api.github.com/users/jhowardmsft","html_url":"https://github.com/jhowardmsft","followers_url":"https://api.github.com/users/jhowardmsft/followers","following_url":"https://api.github.com/users/jhowardmsft/following{/other_user}","gists_url":"https://api.github.com/users/jhowardmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/jhowardmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhowardmsft/subscriptions","organizations_url":"https://api.github.com/users/jhowardmsft/orgs","repos_url":"https://api.github.com/users/jhowardmsft/repos","events_url":"https://api.github.com/users/jhowardmsft/events{/privacy}","received_events_url":"https://api.github.com/users/jhowardmsft/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T02:33:51Z","updated_at":"2015-07-21T02:33:51Z","body":"Went with the much simpler workaround in .vendor-helper.sh from @tianon. This should now be good - waiting for Jenkins. Have done local validation of the Windows daemon and this change is good."}}