{"action":"created","comment":{"url":"https://api.github.com/repos/codership/documentation/pulls/comments/34760972","id":34760972,"diff_hunk":"@@ -0,0 +1,133 @@\n+==========================\n+Using Docker on Linux\n+==========================\n+.. _`docker`:\n+\n+Docker provides an open source platform for automatically deploying applications within software containers on Linux.  You may find it useful in portable deployment across numerous machines, development testing or automatic builds.\n+\n+Galera Cluster can run from within a Docker container.\n+\n+---------------------------\n+Configuring the Container\n+---------------------------\n+.. _`configure-container`:\n+\n+There are two configuration files that you need to create to run Galera Cluster on Docker: ``my.cnf`` and ``Dockerfile``.  Place both of these in the build directory for your container.\n+\n+\n+^^^^^^^^^^^^\n+``my.cnf``\n+^^^^^^^^^^^^\n+.. _`my-cnf`:\n+\n+Galera Cluster sources the ``my.cnf`` configuration file when the database server starts, regardless of whether or not the server is running from within a container.  When you write the configuration file for a container, you follow the same conventions as you would use in the standard deployment for a host operating system.  For example:\n+\n+.. code-block:: ini\n+\n+   [mysqld]\n+   user=mysql\n+   bind-address=0.0.0.0\n+\n+   # Cluster Options\n+   wsrep_provider=/usr/lib/galera/libgalera_smm.so\n+   wsrep_cluster_address=\"gcomm://192.168.1.1, 192.168.1.2, 192.16.1.3\"\n+   wsrep_node_address=\"192.168.1.1\"\n+   wsrep_node_name=\"node1\"\n+   wsrep_cluster_name=\"example_cluster\"\n+\n+   # InnoDB Options\n+   default_storage_engine=innodb\n+   innodb_autoinc_lock_mode=2\n+   innodb_flush_log_at_trx_commit=0\n+\n+   # SST\n+   wsrep_sst_method=rsync\n+\n+Bear in mind that in container deployments, you need to explicitly set the :ref:`wsrep_node_address <wsrep_node_address>` parameter, as Galera Cluster cannot auto-guess the network interface on the host operating system from within the container.\n+   \n+^^^^^^^^^^^^^^^^^^^^^^^^^^\n+``Dockerfile``\n+^^^^^^^^^^^^^^^^^^^^^^^^^^\n+.. _`dockerfile`:\n+\n+Docker images are the containers it has available for launch.  There are a number of base images available through `Docker Hub <https://registry.hub.docker.com>`_.  You can pull these down to your system through the ``docker`` command-line tool.\n+\n+When Docker builds a new image, it sources the ``Dockerfile`` to determine the steps that it needs to take in order to generate the image that you want to use.  To complete automate deployment, this means everything that your system needs to start ready for use from the base operating system, to loading configuration files, to running updates and installations through the package manager.\n+\n+.. code-block:: docker\n+\t\t\n+   FROM ubuntu:14.04\n+   MAINTAINER your name <your.user@company.org>\n+\n+   ENV DEBIAN_FRONTEND noninteractive\n+   \n+   RUN apt-get update \\\n+   apt-get install -y  software-properties-common \\\n+   apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 BC19DDBA \\\n+   add-apt-repository 'deb http://releases.galeracluster.com/debian wheezy main'\n+\n+   RUN apt-get update \\\n+   apt-get install -y galera-3 galera-arbitrator-3 mysql-wsrep-5.6 rsync\n+\n+   COPY my.cnf /etc/mysql/my.cnf\n+   ENTRYPOINT [\"mysqld\"]\n+\n+The example follows the installation process for running Galera Cluster from within a Docker container based on Ubuntu.  When you run the build command, ``docker`` pulls down the Ubuntu 14.04 image from Docker HUb, if it's needed, then runs each command in the ``Dockerfile`` to initialize the image for your use.\n+\n+.. note:: As an alternative to the ``Dockerfile`` above, you can also pull down a pre-built image from Docker Hub.  To do so, run the following command:\n+\n+\t  .. code-block:: console\n+\n+\t     # docker pull erkules/galera:basic\n+\n+-------------------------\n+Building the Container\n+-------------------------\n+.. _`building-the-container`:\n+\n+The purpose of building a Docker container is to reduce the installation, configuration and deployment process for container nodes to a single command.  To manage this, you need to first create an image of the container in which you have Galera Cluster installed, configured and ready for use.\n+\n+.. note:: For Debian- and Ubuntu-based distributions, there is another package that uses the name ``docker``.  Substitute ``docker.io`` for the package name and command-line tool on these distributions.\n+\n+You can build a container node using the Docker command-line tool.\n+\n+.. code-block:: console\n+\n+   # docker build -t centos:galera ./ \n+\n+When this command runs, Docker looks in the working direction, (here ``./``), for the ``Dockerfile``.  It then follows each command in the ``Dockerfile`` to build the image you want.  When the build is complete, you can view the addition among the available images:\n+   \n+.. code-block:: console\n+\n+   # docker images\n+   \n+   REPOSITORY  TAG      IMAGE ID      CREATED        SIZE\n+   centos      galera   53b97c3d7740  2 minutes ago  362.7 MB\n+   centos      centos7  ded7cd95e059  5 weeks ago    185.5 MB\n+\n+You now have a working node image available for use as a container.  You can launch it using the ``docker run`` command.\n+   \n+      \n+\n+-------------------------\n+Deploying the Container\n+-------------------------\n+.. _`deploy-container`:\n+\n+When you finish building images, (or pulling them down from Docker Hub), you're ready to launch containers for your Galera nodes.  You can start a container using the Docker command-line tool with the ``run`` parameter.\n+\n+.. code-block:: console\n+\n+   # docker run -i -d --name Node1 --host node1 \\\n+         -p 3306:3306 -p 4567:4567 -p 4568:4568 -p 4444:4444 \\\n+\t erkules/galera:basic\n+\n+This Docker image uses the database server as an ``ENTRYPOINT`` parameter.  This means that it runs ``/bin/mysqld`` on start.  Meaning that the command launches a container then starts Galera Cluster.\n+\n+.. note:: The above command starts a container node meant to attach to an existing cluster.  If you are starting the first node in a cluster, append the argument ``--wsrep-new-cluster`` to the end of the command.","path":"galeracluster/source/docker.rst","position":127,"original_position":127,"commit_id":"884de3bd1d312b7b77197669485f5addd53c3907","original_commit_id":"884de3bd1d312b7b77197669485f5addd53c3907","user":{"login":"philip-galera","id":8738032,"avatar_url":"https://avatars.githubusercontent.com/u/8738032?v=3","gravatar_id":"","url":"https://api.github.com/users/philip-galera","html_url":"https://github.com/philip-galera","followers_url":"https://api.github.com/users/philip-galera/followers","following_url":"https://api.github.com/users/philip-galera/following{/other_user}","gists_url":"https://api.github.com/users/philip-galera/gists{/gist_id}","starred_url":"https://api.github.com/users/philip-galera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philip-galera/subscriptions","organizations_url":"https://api.github.com/users/philip-galera/orgs","repos_url":"https://api.github.com/users/philip-galera/repos","events_url":"https://api.github.com/users/philip-galera/events{/privacy}","received_events_url":"https://api.github.com/users/philip-galera/received_events","type":"User","site_admin":false},"body":"\"to attach\" -> to be attached","created_at":"2015-07-16T07:11:44Z","updated_at":"2015-07-16T07:11:44Z","html_url":"https://github.com/codership/documentation/pull/95#discussion_r34760972","pull_request_url":"https://api.github.com/repos/codership/documentation/pulls/95","_links":{"self":{"href":"https://api.github.com/repos/codership/documentation/pulls/comments/34760972"},"html":{"href":"https://github.com/codership/documentation/pull/95#discussion_r34760972"},"pull_request":{"href":"https://api.github.com/repos/codership/documentation/pulls/95"}}},"pull_request":{"url":"https://api.github.com/repos/codership/documentation/pulls/95","id":40058770,"html_url":"https://github.com/codership/documentation/pull/95","diff_url":"https://github.com/codership/documentation/pull/95.diff","patch_url":"https://github.com/codership/documentation/pull/95.patch","issue_url":"https://api.github.com/repos/codership/documentation/issues/95","number":95,"state":"open","locked":false,"title":"Merge for Website Update","user":{"login":"kennethpjdyer","id":6652799,"avatar_url":"https://avatars.githubusercontent.com/u/6652799?v=3","gravatar_id":"","url":"https://api.github.com/users/kennethpjdyer","html_url":"https://github.com/kennethpjdyer","followers_url":"https://api.github.com/users/kennethpjdyer/followers","following_url":"https://api.github.com/users/kennethpjdyer/following{/other_user}","gists_url":"https://api.github.com/users/kennethpjdyer/gists{/gist_id}","starred_url":"https://api.github.com/users/kennethpjdyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennethpjdyer/subscriptions","organizations_url":"https://api.github.com/users/kennethpjdyer/orgs","repos_url":"https://api.github.com/users/kennethpjdyer/repos","events_url":"https://api.github.com/users/kennethpjdyer/events{/privacy}","received_events_url":"https://api.github.com/users/kennethpjdyer/received_events","type":"User","site_admin":false},"body":"Update of master branch with new material from draft for site update.  Merge includes:\r\n\r\n- Reorganized the User Guide to introduce a Deployment section, to contain pages relating to methods of deploying Galera Cluster, moved Cluster Deployment Variants to this section.\r\n- Created a Docker page, showing how to set up Docker containers for deploying Galera nodes.\r\n- Documented wsrep_log_conflicts parameter.\r\n- On MySQL wsrep options, changed Local variables to Session variables.\r\n- Fixes for various typos and errors.","created_at":"2015-07-15T19:16:27Z","updated_at":"2015-07-16T07:11:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3d150bddb0928a7067276e6464c64d76fe7dbc73","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codership/documentation/pulls/95/commits","review_comments_url":"https://api.github.com/repos/codership/documentation/pulls/95/comments","review_comment_url":"https://api.github.com/repos/codership/documentation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codership/documentation/issues/95/comments","statuses_url":"https://api.github.com/repos/codership/documentation/statuses/884de3bd1d312b7b77197669485f5addd53c3907","head":{"label":"codership:draft","ref":"draft","sha":"884de3bd1d312b7b77197669485f5addd53c3907","user":{"login":"codership","id":1644626,"avatar_url":"https://avatars.githubusercontent.com/u/1644626?v=3","gravatar_id":"","url":"https://api.github.com/users/codership","html_url":"https://github.com/codership","followers_url":"https://api.github.com/users/codership/followers","following_url":"https://api.github.com/users/codership/following{/other_user}","gists_url":"https://api.github.com/users/codership/gists{/gist_id}","starred_url":"https://api.github.com/users/codership/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codership/subscriptions","organizations_url":"https://api.github.com/users/codership/orgs","repos_url":"https://api.github.com/users/codership/repos","events_url":"https://api.github.com/users/codership/events{/privacy}","received_events_url":"https://api.github.com/users/codership/received_events","type":"Organization","site_admin":false},"repo":{"id":24181108,"name":"documentation","full_name":"codership/documentation","owner":{"login":"codership","id":1644626,"avatar_url":"https://avatars.githubusercontent.com/u/1644626?v=3","gravatar_id":"","url":"https://api.github.com/users/codership","html_url":"https://github.com/codership","followers_url":"https://api.github.com/users/codership/followers","following_url":"https://api.github.com/users/codership/following{/other_user}","gists_url":"https://api.github.com/users/codership/gists{/gist_id}","starred_url":"https://api.github.com/users/codership/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codership/subscriptions","organizations_url":"https://api.github.com/users/codership/orgs","repos_url":"https://api.github.com/users/codership/repos","events_url":"https://api.github.com/users/codership/events{/privacy}","received_events_url":"https://api.github.com/users/codership/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codership/documentation","description":"","fork":false,"url":"https://api.github.com/repos/codership/documentation","forks_url":"https://api.github.com/repos/codership/documentation/forks","keys_url":"https://api.github.com/repos/codership/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codership/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codership/documentation/teams","hooks_url":"https://api.github.com/repos/codership/documentation/hooks","issue_events_url":"https://api.github.com/repos/codership/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/codership/documentation/events","assignees_url":"https://api.github.com/repos/codership/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/codership/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/codership/documentation/tags","blobs_url":"https://api.github.com/repos/codership/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codership/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codership/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/codership/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codership/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/codership/documentation/languages","stargazers_url":"https://api.github.com/repos/codership/documentation/stargazers","contributors_url":"https://api.github.com/repos/codership/documentation/contributors","subscribers_url":"https://api.github.com/repos/codership/documentation/subscribers","subscription_url":"https://api.github.com/repos/codership/documentation/subscription","commits_url":"https://api.github.com/repos/codership/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/codership/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/codership/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/codership/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/codership/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/codership/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codership/documentation/merges","archive_url":"https://api.github.com/repos/codership/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codership/documentation/downloads","issues_url":"https://api.github.com/repos/codership/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/codership/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/codership/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/codership/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codership/documentation/labels{/name}","releases_url":"https://api.github.com/repos/codership/documentation/releases{/id}","created_at":"2014-09-18T08:56:28Z","updated_at":"2015-06-29T19:49:14Z","pushed_at":"2015-07-15T19:16:28Z","git_url":"git://github.com/codership/documentation.git","ssh_url":"git@github.com:codership/documentation.git","clone_url":"https://github.com/codership/documentation.git","svn_url":"https://github.com/codership/documentation","homepage":null,"size":1751,"stargazers_count":4,"watchers_count":4,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":39,"forks":14,"open_issues":39,"watchers":4,"default_branch":"master"}},"base":{"label":"codership:master","ref":"master","sha":"bbc2ec3a24d86b0569fdbad11ba6680af7e45f66","user":{"login":"codership","id":1644626,"avatar_url":"https://avatars.githubusercontent.com/u/1644626?v=3","gravatar_id":"","url":"https://api.github.com/users/codership","html_url":"https://github.com/codership","followers_url":"https://api.github.com/users/codership/followers","following_url":"https://api.github.com/users/codership/following{/other_user}","gists_url":"https://api.github.com/users/codership/gists{/gist_id}","starred_url":"https://api.github.com/users/codership/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codership/subscriptions","organizations_url":"https://api.github.com/users/codership/orgs","repos_url":"https://api.github.com/users/codership/repos","events_url":"https://api.github.com/users/codership/events{/privacy}","received_events_url":"https://api.github.com/users/codership/received_events","type":"Organization","site_admin":false},"repo":{"id":24181108,"name":"documentation","full_name":"codership/documentation","owner":{"login":"codership","id":1644626,"avatar_url":"https://avatars.githubusercontent.com/u/1644626?v=3","gravatar_id":"","url":"https://api.github.com/users/codership","html_url":"https://github.com/codership","followers_url":"https://api.github.com/users/codership/followers","following_url":"https://api.github.com/users/codership/following{/other_user}","gists_url":"https://api.github.com/users/codership/gists{/gist_id}","starred_url":"https://api.github.com/users/codership/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codership/subscriptions","organizations_url":"https://api.github.com/users/codership/orgs","repos_url":"https://api.github.com/users/codership/repos","events_url":"https://api.github.com/users/codership/events{/privacy}","received_events_url":"https://api.github.com/users/codership/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codership/documentation","description":"","fork":false,"url":"https://api.github.com/repos/codership/documentation","forks_url":"https://api.github.com/repos/codership/documentation/forks","keys_url":"https://api.github.com/repos/codership/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codership/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codership/documentation/teams","hooks_url":"https://api.github.com/repos/codership/documentation/hooks","issue_events_url":"https://api.github.com/repos/codership/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/codership/documentation/events","assignees_url":"https://api.github.com/repos/codership/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/codership/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/codership/documentation/tags","blobs_url":"https://api.github.com/repos/codership/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codership/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codership/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/codership/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codership/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/codership/documentation/languages","stargazers_url":"https://api.github.com/repos/codership/documentation/stargazers","contributors_url":"https://api.github.com/repos/codership/documentation/contributors","subscribers_url":"https://api.github.com/repos/codership/documentation/subscribers","subscription_url":"https://api.github.com/repos/codership/documentation/subscription","commits_url":"https://api.github.com/repos/codership/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/codership/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/codership/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/codership/documentation/issues/comments{/number}","contents_url":"https://api.github.com/repos/codership/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/codership/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codership/documentation/merges","archive_url":"https://api.github.com/repos/codership/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codership/documentation/downloads","issues_url":"https://api.github.com/repos/codership/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/codership/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/codership/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/codership/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codership/documentation/labels{/name}","releases_url":"https://api.github.com/repos/codership/documentation/releases{/id}","created_at":"2014-09-18T08:56:28Z","updated_at":"2015-06-29T19:49:14Z","pushed_at":"2015-07-15T19:16:28Z","git_url":"git://github.com/codership/documentation.git","ssh_url":"git@github.com:codership/documentation.git","clone_url":"https://github.com/codership/documentation.git","svn_url":"https://github.com/codership/documentation","homepage":null,"size":1751,"stargazers_count":4,"watchers_count":4,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":39,"forks":14,"open_issues":39,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codership/documentation/pulls/95"},"html":{"href":"https://github.com/codership/documentation/pull/95"},"issue":{"href":"https://api.github.com/repos/codership/documentation/issues/95"},"comments":{"href":"https://api.github.com/repos/codership/documentation/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/codership/documentation/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/codership/documentation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codership/documentation/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/codership/documentation/statuses/884de3bd1d312b7b77197669485f5addd53c3907"}}}}