{"action":"opened","number":2040,"pull_request":{"url":"https://api.github.com/repos/coreos/rkt/pulls/2040","id":57347902,"html_url":"https://github.com/coreos/rkt/pull/2040","diff_url":"https://github.com/coreos/rkt/pull/2040.diff","patch_url":"https://github.com/coreos/rkt/pull/2040.patch","issue_url":"https://api.github.com/repos/coreos/rkt/issues/2040","number":2040,"state":"open","locked":false,"title":"*: fill resolv.conf from command line --dns","user":{"login":"alban","id":27575,"avatar_url":"https://avatars.githubusercontent.com/u/27575?v=3","gravatar_id":"","url":"https://api.github.com/users/alban","html_url":"https://github.com/alban","followers_url":"https://api.github.com/users/alban/followers","following_url":"https://api.github.com/users/alban/following{/other_user}","gists_url":"https://api.github.com/users/alban/gists{/gist_id}","starred_url":"https://api.github.com/users/alban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alban/subscriptions","organizations_url":"https://api.github.com/users/alban/orgs","repos_url":"https://api.github.com/users/alban/repos","events_url":"https://api.github.com/users/alban/events{/privacy}","received_events_url":"https://api.github.com/users/alban/received_events","type":"User","site_admin":false},"body":"rkt now provides /etc/resolv.conf in each app's chroot.\r\n\r\nGetting DNS information from the CNI or from the host's resolv.conf is\r\nout of scope of this patch. The content of /etc/resolv.conf comes from\r\nthe command line parameters:\r\n- \"--dns=\": comma-separated list\r\n\r\nImplementation detail: systemd-nspawn can overwrite /etc/resolv.conf. It\r\nis supposed to overwrite it only when the container uses the host\r\nnetwork namespace.  However, the container network namespace is created\r\nby rkt via CNI and not by systemd-nspawn, so systemd-nspawn is not aware\r\nof the network configuration. As a consequence, we cannot use stage1's\r\n/etc/resolv.conf. Instead, rkt write /etc/rkt-resolv.conf in stage1 and\r\nprepare-app bind-mounts it in stage2's /etc/resolv.conf.\r\n\r\nIt works in this way:\r\n\r\n> $ sudo rkt run --net=alban --dns=1.1.1.1,2.2.2.2 \\\r\n> \t\tsha512-a2fb8f390702 --interactive\r\n> / # cat /etc/resolv.conf\r\n> # Generated by rkt\r\n>\r\n> # Name servers passed on the command line\r\n> nameserver 1.1.1.1\r\n> nameserver 2.2.2.2\r\n> / #\r\n\r\nFixes https://github.com/coreos/rkt/issues/660\r\n\r\n-----\r\n\r\n/cc @steveeJ I can add tests and `--dns-search=` after lunch. One difference compared to #2032 is that /etc/resolv.conf is not created if the user does not add `--dns=`. Also, if the ACI does not have a /etc/resolv.conf, it is created automatically.","created_at":"2016-01-27T11:38:03Z","updated_at":"2016-01-27T11:38:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coreos/rkt/pulls/2040/commits","review_comments_url":"https://api.github.com/repos/coreos/rkt/pulls/2040/comments","review_comment_url":"https://api.github.com/repos/coreos/rkt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/rkt/issues/2040/comments","statuses_url":"https://api.github.com/repos/coreos/rkt/statuses/aa71da21128a6bad066d94082b445b069a670f1d","head":{"label":"kinvolk:alban/dns-2","ref":"alban/dns-2","sha":"aa71da21128a6bad066d94082b445b069a670f1d","user":{"login":"kinvolk","id":14073052,"avatar_url":"https://avatars.githubusercontent.com/u/14073052?v=3","gravatar_id":"","url":"https://api.github.com/users/kinvolk","html_url":"https://github.com/kinvolk","followers_url":"https://api.github.com/users/kinvolk/followers","following_url":"https://api.github.com/users/kinvolk/following{/other_user}","gists_url":"https://api.github.com/users/kinvolk/gists{/gist_id}","starred_url":"https://api.github.com/users/kinvolk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinvolk/subscriptions","organizations_url":"https://api.github.com/users/kinvolk/orgs","repos_url":"https://api.github.com/users/kinvolk/repos","events_url":"https://api.github.com/users/kinvolk/events{/privacy}","received_events_url":"https://api.github.com/users/kinvolk/received_events","type":"Organization","site_admin":false},"repo":{"id":45149715,"name":"rkt","full_name":"kinvolk/rkt","owner":{"login":"kinvolk","id":14073052,"avatar_url":"https://avatars.githubusercontent.com/u/14073052?v=3","gravatar_id":"","url":"https://api.github.com/users/kinvolk","html_url":"https://github.com/kinvolk","followers_url":"https://api.github.com/users/kinvolk/followers","following_url":"https://api.github.com/users/kinvolk/following{/other_user}","gists_url":"https://api.github.com/users/kinvolk/gists{/gist_id}","starred_url":"https://api.github.com/users/kinvolk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinvolk/subscriptions","organizations_url":"https://api.github.com/users/kinvolk/orgs","repos_url":"https://api.github.com/users/kinvolk/repos","events_url":"https://api.github.com/users/kinvolk/events{/privacy}","received_events_url":"https://api.github.com/users/kinvolk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kinvolk/rkt","description":"rkt is an App Container runtime for Linux","fork":true,"url":"https://api.github.com/repos/kinvolk/rkt","forks_url":"https://api.github.com/repos/kinvolk/rkt/forks","keys_url":"https://api.github.com/repos/kinvolk/rkt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kinvolk/rkt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kinvolk/rkt/teams","hooks_url":"https://api.github.com/repos/kinvolk/rkt/hooks","issue_events_url":"https://api.github.com/repos/kinvolk/rkt/issues/events{/number}","events_url":"https://api.github.com/repos/kinvolk/rkt/events","assignees_url":"https://api.github.com/repos/kinvolk/rkt/assignees{/user}","branches_url":"https://api.github.com/repos/kinvolk/rkt/branches{/branch}","tags_url":"https://api.github.com/repos/kinvolk/rkt/tags","blobs_url":"https://api.github.com/repos/kinvolk/rkt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kinvolk/rkt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kinvolk/rkt/git/refs{/sha}","trees_url":"https://api.github.com/repos/kinvolk/rkt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kinvolk/rkt/statuses/{sha}","languages_url":"https://api.github.com/repos/kinvolk/rkt/languages","stargazers_url":"https://api.github.com/repos/kinvolk/rkt/stargazers","contributors_url":"https://api.github.com/repos/kinvolk/rkt/contributors","subscribers_url":"https://api.github.com/repos/kinvolk/rkt/subscribers","subscription_url":"https://api.github.com/repos/kinvolk/rkt/subscription","commits_url":"https://api.github.com/repos/kinvolk/rkt/commits{/sha}","git_commits_url":"https://api.github.com/repos/kinvolk/rkt/git/commits{/sha}","comments_url":"https://api.github.com/repos/kinvolk/rkt/comments{/number}","issue_comment_url":"https://api.github.com/repos/kinvolk/rkt/issues/comments{/number}","contents_url":"https://api.github.com/repos/kinvolk/rkt/contents/{+path}","compare_url":"https://api.github.com/repos/kinvolk/rkt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kinvolk/rkt/merges","archive_url":"https://api.github.com/repos/kinvolk/rkt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kinvolk/rkt/downloads","issues_url":"https://api.github.com/repos/kinvolk/rkt/issues{/number}","pulls_url":"https://api.github.com/repos/kinvolk/rkt/pulls{/number}","milestones_url":"https://api.github.com/repos/kinvolk/rkt/milestones{/number}","notifications_url":"https://api.github.com/repos/kinvolk/rkt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kinvolk/rkt/labels{/name}","releases_url":"https://api.github.com/repos/kinvolk/rkt/releases{/id}","deployments_url":"https://api.github.com/repos/kinvolk/rkt/deployments","created_at":"2015-10-29T00:17:06Z","updated_at":"2016-01-13T16:51:16Z","pushed_at":"2016-01-27T11:33:52Z","git_url":"git://github.com/kinvolk/rkt.git","ssh_url":"git@github.com:kinvolk/rkt.git","clone_url":"https://github.com/kinvolk/rkt.git","svn_url":"https://github.com/kinvolk/rkt","homepage":"","size":18852,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"coreos:master","ref":"master","sha":"646746d9b0ef29c2145a3d8c04823c1b6f42c53b","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":26509369,"name":"rkt","full_name":"coreos/rkt","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/rkt","description":"rkt is an App Container runtime for Linux","fork":false,"url":"https://api.github.com/repos/coreos/rkt","forks_url":"https://api.github.com/repos/coreos/rkt/forks","keys_url":"https://api.github.com/repos/coreos/rkt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/rkt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/rkt/teams","hooks_url":"https://api.github.com/repos/coreos/rkt/hooks","issue_events_url":"https://api.github.com/repos/coreos/rkt/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/rkt/events","assignees_url":"https://api.github.com/repos/coreos/rkt/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/rkt/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/rkt/tags","blobs_url":"https://api.github.com/repos/coreos/rkt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/rkt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/rkt/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/rkt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/rkt/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/rkt/languages","stargazers_url":"https://api.github.com/repos/coreos/rkt/stargazers","contributors_url":"https://api.github.com/repos/coreos/rkt/contributors","subscribers_url":"https://api.github.com/repos/coreos/rkt/subscribers","subscription_url":"https://api.github.com/repos/coreos/rkt/subscription","commits_url":"https://api.github.com/repos/coreos/rkt/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/rkt/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/rkt/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/rkt/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/rkt/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/rkt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/rkt/merges","archive_url":"https://api.github.com/repos/coreos/rkt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/rkt/downloads","issues_url":"https://api.github.com/repos/coreos/rkt/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/rkt/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/rkt/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/rkt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/rkt/labels{/name}","releases_url":"https://api.github.com/repos/coreos/rkt/releases{/id}","deployments_url":"https://api.github.com/repos/coreos/rkt/deployments","created_at":"2014-11-11T23:13:18Z","updated_at":"2016-01-26T18:52:07Z","pushed_at":"2016-01-27T11:38:04Z","git_url":"git://github.com/coreos/rkt.git","ssh_url":"git@github.com:coreos/rkt.git","clone_url":"https://github.com/coreos/rkt.git","svn_url":"https://github.com/coreos/rkt","homepage":"","size":22184,"stargazers_count":5039,"watchers_count":5039,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":438,"mirror_url":null,"open_issues_count":210,"forks":438,"open_issues":210,"watchers":5039,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/rkt/pulls/2040"},"html":{"href":"https://github.com/coreos/rkt/pull/2040"},"issue":{"href":"https://api.github.com/repos/coreos/rkt/issues/2040"},"comments":{"href":"https://api.github.com/repos/coreos/rkt/issues/2040/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/rkt/pulls/2040/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/rkt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/rkt/pulls/2040/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/rkt/statuses/aa71da21128a6bad066d94082b445b069a670f1d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":56,"deletions":3,"changed_files":3}}