{"action":"created","comment":{"url":"https://api.github.com/repos/SUSE/kiwi/pulls/comments/68386390","id":68386390,"diff_hunk":"@@ -0,0 +1,282 @@\n+Building in a Self-Contained Environment\n+========================================\n+\n+.. topic:: Abstract\n+\n+   Users building images with KIWI face problems if they want\n+   to build as non root user or can't install KIWI on their\n+   system due to inappropriate build host requirements or\n+   project policies.\n+\n+   This document describes how to perform the build process in\n+   a Docker container using the Dice containment build system\n+   written for KIWI.\n+\n+   The changes to the machine to become a build host will\n+   be reduced to the requirements of Dice and Docker.\n+\n+Requirements\n+------------\n+\n+The following components needs to be installed on the build system:\n+\n+* Dice - a containment build system for KIWI.\n+\n+* Docker - a container framework based on the Linux\n+  container support in the kernel.\n+\n+* Docker Build Container for KIWI.\n+\n+* optionally Vagrant - a framework to run, provision and control\n+  virtual machines and container instances. Vagrant has a very nice\n+  interface to provision a machine prior to running the actual build.\n+  It also supports docker as a provider which makes it a perfect fit\n+  for complex provisioning tasks in combination with the Docker\n+  container system.\n+\n+Installing and Setting up Dice\n+------------------------------\n+\n+The Dice packages and sources are available at the following locations:\n+\n+* Build service project: https://build.opensuse.org/project/show/Virtualization:Appliances:ContainerBuilder\n+* Sources: https://github.com/SUSE/dice\n+\n+.. code:: bash\n+\n+    $ sudo zypper in ruby2.1-rubygem-dice\n+\n+Installing and Setting up Docker\n+--------------------------------\n+\n+Docker packages are usually available with the used distribution.\n+\n+.. code:: bash\n+\n+    $ sudo zypper in docker\n+\n+Make sure that the user, who is intended to build images, is a member\n+of the `docker` group. Run the following command:\n+\n+.. code:: bash\n+\n+    $ sudo useradd -G docker <builduser>\n+\n+It is required to logout and login again to let this change\n+become active.\n+\n+Once this is done you need to setup the Docker storage backend.\n+By default Docker uses the device mapper to manage the storage for\n+the containers it starts. Unfortunately, this does not work if the\n+container is supposed to build images because it runs into conflicts\n+with tools like :command:`kpartx` which itself maps devices using\n+the device mapper.\n+\n+Fortunately, there is a solution for Docker which allows us to use\n+Btrfs as the storage backend. The following is only required if your\n+host system root filesystem is not btrfs:\n+\n+.. code:: bash\n+\n+    $ sudo qemu-img create /var/lib/docker-storage.btrfs 20g\n+    $ sudo mkfs.btrfs /var/lib/docker-storage.btrfs\n+    $ sudo mkdir -p /var/lib/docker\n+    $ sudo mount /var/lib/docker-storage.btrfs /var/lib/docker\n+\n+    $ sudo vi /etc/fstab\n+\n+      /var/lib/docker-storage.btrfs /var/lib/docker btrfs defaults 0 0\n+\n+    $ sudo vi /etc/sysconfig/docker\n+\n+      DOCKER_OPTS=\"-s btrfs\"\n+\n+Finally start the docker service:\n+\n+.. code:: bash\n+\n+    $ sudo systemctl restart docker\n+\n+Installing and Setting up the Build Container\n+----------------------------------------------\n+\n+In order to build in a contained environment Docker has to start a\n+privileged system container. Such a container must be imported before\n+Docker can use it. The Build Container is provided to you as a\n+service and build with KIWI in the project\n+at https://build.opensuse.org/project/show/Virtualization:Appliances:Images\n+On a regular basis the result image is pushed\n+to https://hub.docker.com/r/opensuse/dice.\n+\n+There are two ways to import the Build Container to your local Docker system\n+\n+1. Download from the openSUSE Buildservice and manually import\n+2. Use :command:`docker` to pull the box from Dockerhub\n+\n+Pull from Dockerhub\n+-------------------\n+\n+.. code:: bash\n+\n+    $ docker pull opensuse/dice:latest\n+\n+Download from the Open BuildService\n+-----------------------------------\n+\n+Download the .tar.bz2 file which starts with :file:`Docker-Tumbleweed`\n+\n+.. code:: bash\n+\n+    $ wget http://download.opensuse.org/repositories/Virtualization:/Appliances:/Images/images/Docker-Tumbleweed.XXXXXXX.docker.tar.xz\n+\n+Import the downloaded tarball to docker as follows:","path":"doc/source/container_builder.rst","position":132,"original_position":132,"commit_id":"f2bd051d316c46a31dc11352402932ce73e69b15","original_commit_id":"f2bd051d316c46a31dc11352402932ce73e69b15","user":{"login":"tomschr","id":1312925,"avatar_url":"https://avatars.githubusercontent.com/u/1312925?v=3","gravatar_id":"","url":"https://api.github.com/users/tomschr","html_url":"https://github.com/tomschr","followers_url":"https://api.github.com/users/tomschr/followers","following_url":"https://api.github.com/users/tomschr/following{/other_user}","gists_url":"https://api.github.com/users/tomschr/gists{/gist_id}","starred_url":"https://api.github.com/users/tomschr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomschr/subscriptions","organizations_url":"https://api.github.com/users/tomschr/orgs","repos_url":"https://api.github.com/users/tomschr/repos","events_url":"https://api.github.com/users/tomschr/events{/privacy}","received_events_url":"https://api.github.com/users/tomschr/received_events","type":"User","site_admin":false},"body":"to docker -> with :command:`docker` as follows:","created_at":"2016-06-24T11:37:43Z","updated_at":"2016-06-24T11:37:43Z","html_url":"https://github.com/SUSE/kiwi/pull/101#discussion_r68386390","pull_request_url":"https://api.github.com/repos/SUSE/kiwi/pulls/101","_links":{"self":{"href":"https://api.github.com/repos/SUSE/kiwi/pulls/comments/68386390"},"html":{"href":"https://github.com/SUSE/kiwi/pull/101#discussion_r68386390"},"pull_request":{"href":"https://api.github.com/repos/SUSE/kiwi/pulls/101"}}},"pull_request":{"url":"https://api.github.com/repos/SUSE/kiwi/pulls/101","id":74622919,"html_url":"https://github.com/SUSE/kiwi/pull/101","diff_url":"https://github.com/SUSE/kiwi/pull/101.diff","patch_url":"https://github.com/SUSE/kiwi/pull/101.patch","issue_url":"https://api.github.com/repos/SUSE/kiwi/issues/101","number":101,"state":"open","locked":false,"title":"Added article about self contained building","user":{"login":"schaefi","id":912234,"avatar_url":"https://avatars.githubusercontent.com/u/912234?v=3","gravatar_id":"","url":"https://api.github.com/users/schaefi","html_url":"https://github.com/schaefi","followers_url":"https://api.github.com/users/schaefi/followers","following_url":"https://api.github.com/users/schaefi/following{/other_user}","gists_url":"https://api.github.com/users/schaefi/gists{/gist_id}","starred_url":"https://api.github.com/users/schaefi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schaefi/subscriptions","organizations_url":"https://api.github.com/users/schaefi/orgs","repos_url":"https://api.github.com/users/schaefi/repos","events_url":"https://api.github.com/users/schaefi/events{/privacy}","received_events_url":"https://api.github.com/users/schaefi/received_events","type":"User","site_admin":false},"body":"Documentation\r\n\r\nThe article describes how to make use of the dice project to control and maintain image\r\nbuild processes in a contained environment","created_at":"2016-06-21T14:33:41Z","updated_at":"2016-06-24T11:37:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8740348fa86c4ae16622a9eb676c5529054ecca8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SUSE/kiwi/pulls/101/commits","review_comments_url":"https://api.github.com/repos/SUSE/kiwi/pulls/101/comments","review_comment_url":"https://api.github.com/repos/SUSE/kiwi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SUSE/kiwi/issues/101/comments","statuses_url":"https://api.github.com/repos/SUSE/kiwi/statuses/f2bd051d316c46a31dc11352402932ce73e69b15","head":{"label":"SUSE:dice-documentation","ref":"dice-documentation","sha":"f2bd051d316c46a31dc11352402932ce73e69b15","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":47460440,"name":"kiwi","full_name":"SUSE/kiwi","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/kiwi","description":"KIWI—Appliance Builder Next Generation","fork":false,"url":"https://api.github.com/repos/SUSE/kiwi","forks_url":"https://api.github.com/repos/SUSE/kiwi/forks","keys_url":"https://api.github.com/repos/SUSE/kiwi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/kiwi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/kiwi/teams","hooks_url":"https://api.github.com/repos/SUSE/kiwi/hooks","issue_events_url":"https://api.github.com/repos/SUSE/kiwi/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/kiwi/events","assignees_url":"https://api.github.com/repos/SUSE/kiwi/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/kiwi/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/kiwi/tags","blobs_url":"https://api.github.com/repos/SUSE/kiwi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/kiwi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/kiwi/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/kiwi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/kiwi/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/kiwi/languages","stargazers_url":"https://api.github.com/repos/SUSE/kiwi/stargazers","contributors_url":"https://api.github.com/repos/SUSE/kiwi/contributors","subscribers_url":"https://api.github.com/repos/SUSE/kiwi/subscribers","subscription_url":"https://api.github.com/repos/SUSE/kiwi/subscription","commits_url":"https://api.github.com/repos/SUSE/kiwi/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/kiwi/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/kiwi/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/kiwi/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/kiwi/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/kiwi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/kiwi/merges","archive_url":"https://api.github.com/repos/SUSE/kiwi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/kiwi/downloads","issues_url":"https://api.github.com/repos/SUSE/kiwi/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/kiwi/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/kiwi/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/kiwi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/kiwi/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/kiwi/releases{/id}","deployments_url":"https://api.github.com/repos/SUSE/kiwi/deployments","created_at":"2015-12-05T15:11:01Z","updated_at":"2016-05-20T17:37:34Z","pushed_at":"2016-06-24T09:43:07Z","git_url":"git://github.com/SUSE/kiwi.git","ssh_url":"git@github.com:SUSE/kiwi.git","clone_url":"https://github.com/SUSE/kiwi.git","svn_url":"https://github.com/SUSE/kiwi","homepage":"https://suse.github.io/kiwi","size":5674,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":16,"forks":6,"open_issues":16,"watchers":11,"default_branch":"master"}},"base":{"label":"SUSE:master","ref":"master","sha":"a2118ffb611488310a4ccfcdfe99eb26b638f42c","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":47460440,"name":"kiwi","full_name":"SUSE/kiwi","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/kiwi","description":"KIWI—Appliance Builder Next Generation","fork":false,"url":"https://api.github.com/repos/SUSE/kiwi","forks_url":"https://api.github.com/repos/SUSE/kiwi/forks","keys_url":"https://api.github.com/repos/SUSE/kiwi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/kiwi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/kiwi/teams","hooks_url":"https://api.github.com/repos/SUSE/kiwi/hooks","issue_events_url":"https://api.github.com/repos/SUSE/kiwi/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/kiwi/events","assignees_url":"https://api.github.com/repos/SUSE/kiwi/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/kiwi/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/kiwi/tags","blobs_url":"https://api.github.com/repos/SUSE/kiwi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/kiwi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/kiwi/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/kiwi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/kiwi/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/kiwi/languages","stargazers_url":"https://api.github.com/repos/SUSE/kiwi/stargazers","contributors_url":"https://api.github.com/repos/SUSE/kiwi/contributors","subscribers_url":"https://api.github.com/repos/SUSE/kiwi/subscribers","subscription_url":"https://api.github.com/repos/SUSE/kiwi/subscription","commits_url":"https://api.github.com/repos/SUSE/kiwi/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/kiwi/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/kiwi/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/kiwi/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/kiwi/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/kiwi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/kiwi/merges","archive_url":"https://api.github.com/repos/SUSE/kiwi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/kiwi/downloads","issues_url":"https://api.github.com/repos/SUSE/kiwi/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/kiwi/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/kiwi/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/kiwi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/kiwi/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/kiwi/releases{/id}","deployments_url":"https://api.github.com/repos/SUSE/kiwi/deployments","created_at":"2015-12-05T15:11:01Z","updated_at":"2016-05-20T17:37:34Z","pushed_at":"2016-06-24T09:43:07Z","git_url":"git://github.com/SUSE/kiwi.git","ssh_url":"git@github.com:SUSE/kiwi.git","clone_url":"https://github.com/SUSE/kiwi.git","svn_url":"https://github.com/SUSE/kiwi","homepage":"https://suse.github.io/kiwi","size":5674,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":16,"forks":6,"open_issues":16,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SUSE/kiwi/pulls/101"},"html":{"href":"https://github.com/SUSE/kiwi/pull/101"},"issue":{"href":"https://api.github.com/repos/SUSE/kiwi/issues/101"},"comments":{"href":"https://api.github.com/repos/SUSE/kiwi/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/SUSE/kiwi/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/SUSE/kiwi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SUSE/kiwi/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/SUSE/kiwi/statuses/f2bd051d316c46a31dc11352402932ce73e69b15"}}}}
{"actor":{"display_login":"tomschr"}}