mirror of https://github.com/docker/docs.git
3131 lines
143 KiB
XML
3131 lines
143 KiB
XML
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||
<channel>
|
||
<title>Projects on Docker Docs</title>
|
||
<link>http://localhost/project/</link>
|
||
<description>Recent content in Projects on Docker Docs</description>
|
||
<generator>Hugo -- gohugo.io</generator>
|
||
<language>en-us</language>
|
||
<atom:link href="http://localhost/project/index.xml" rel="self" type="application/rss+xml" />
|
||
|
||
<item>
|
||
<title>Advanced contributing</title>
|
||
<link>http://localhost/project/advanced-contributing/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/advanced-contributing/</guid>
|
||
<description>
|
||
|
||
<h1 id="advanced-contributing">Advanced contributing</h1>
|
||
|
||
<p>In this section, you learn about the more advanced contributions you can make.
|
||
They are advanced because they have a more involved workflow or require greater
|
||
programming experience. Don&rsquo;t be scared off though, if you like to stretch and
|
||
challenge yourself, this is the place for you.</p>
|
||
|
||
<p>This section gives generalized instructions for advanced contributions. You&rsquo;ll
|
||
read about the workflow but there are not specific descriptions of commands.
|
||
Your goal should be to understand the processes described.</p>
|
||
|
||
<p>At this point, you should have read and worked through the earlier parts of
|
||
the project contributor guide. You should also have
|
||
<a href="../make-a-contribution/" target="_blank"> made at least one project contribution</a>.</p>
|
||
|
||
<h2 id="refactor-or-cleanup-proposal">Refactor or cleanup proposal</h2>
|
||
|
||
<p>A refactor or cleanup proposal changes Docker&rsquo;s internal structure without
|
||
altering the external behavior. To make this type of proposal:</p>
|
||
|
||
<ol>
|
||
<li><p>Fork <code>docker/docker</code>.</p></li>
|
||
|
||
<li><p>Make your changes in a feature branch.</p></li>
|
||
|
||
<li><p>Sync and rebase with <code>master</code> as you work.</p></li>
|
||
|
||
<li><p>Run the full test suite.</p></li>
|
||
|
||
<li><p>Submit your code through a pull request (PR).</p>
|
||
|
||
<p>The PR&rsquo;s title should have the format:</p>
|
||
|
||
<p><strong>Cleanup:</strong> <em>short title</em></p>
|
||
|
||
<p>If your changes required logic changes, note that in your request.</p></li>
|
||
|
||
<li><p>Work through Docker&rsquo;s review process until merge.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="design-proposal">Design proposal</h2>
|
||
|
||
<p>A design proposal solves a problem or adds a feature to the Docker software.
|
||
The process for submitting design proposals requires two pull requests, one
|
||
for the design and one for the implementation.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/proposal.png" alt="Simple process" />
|
||
</p>
|
||
|
||
<p>The important thing to notice is that both the design pull request and the
|
||
implementation pull request go through a review. In other words, there is
|
||
considerable time commitment in a design proposal; so, you might want to pair
|
||
with someone on design work.</p>
|
||
|
||
<p>The following provides greater detail on the process:</p>
|
||
|
||
<ol>
|
||
<li><p>Come up with an idea.</p>
|
||
|
||
<p>Ideas usually come from limitations users feel working with a product. So,
|
||
take some time to really use Docker. Try it on different platforms; explore
|
||
how it works with different web applications. Go to some community events
|
||
and find out what other users want.</p></li>
|
||
|
||
<li><p>Review existing issues and proposals to make sure no other user is proposing a similar idea.</p>
|
||
|
||
<p>The design proposals are <a
|
||
href="https://github.com/docker/docker/pulls?q=is%3Aopen+is%3Apr+label%
|
||
3Akind%2Fproposal" target="_blank">all online in our GitHub pull requests</a>.</p></li>
|
||
|
||
<li><p>Talk to the community about your idea.</p>
|
||
|
||
<p>We have lots of <a href="../get-help/" target="_blank">community forums</a>
|
||
where you can get feedback on your idea. Float your idea in a forum or two
|
||
to get some commentary going on it.</p></li>
|
||
|
||
<li><p>Fork <code>docker/docker</code> and clone the repo to your local host.</p></li>
|
||
|
||
<li><p>Create a new Markdown file in the area you wish to change.</p>
|
||
|
||
<p>For example, if you want to redesign our daemon create a new file under the
|
||
<code>daemon/</code> folder.</p></li>
|
||
|
||
<li><p>Name the file descriptively, for example <code>redesign-daemon-proposal.md</code>.</p></li>
|
||
|
||
<li><p>Write a proposal for your change into the file.</p>
|
||
|
||
<p>This is a Markdown file that describes your idea. Your proposal
|
||
should include information like:</p>
|
||
|
||
<ul>
|
||
<li>Why is this change needed or what are the use cases?</li>
|
||
<li>What are the requirements this change should meet?</li>
|
||
<li>What are some ways to design/implement this feature?</li>
|
||
<li>Which design/implementation do you think is best and why?</li>
|
||
<li>What are the risks or limitations of your proposal?</li>
|
||
</ul>
|
||
|
||
<p>This is your chance to convince people your idea is sound.</p></li>
|
||
|
||
<li><p>Submit your proposal in a pull request to <code>docker/docker</code>.</p>
|
||
|
||
<p>The title should have the format:</p>
|
||
|
||
<p><strong>Proposal:</strong> <em>short title</em></p>
|
||
|
||
<p>The body of the pull request should include a brief summary of your change
|
||
and then say something like &ldquo;<em>See the file for a complete description</em>&rdquo;.</p></li>
|
||
|
||
<li><p>Refine your proposal through review.</p>
|
||
|
||
<p>The maintainers and the community review your proposal. You&rsquo;ll need to
|
||
answer questions and sometimes explain or defend your approach. This is
|
||
chance for everyone to both teach and learn.</p></li>
|
||
|
||
<li><p>Pull request accepted.</p>
|
||
|
||
<p>Your request may also be rejected. Not every idea is a good fit for Docker.
|
||
Let&rsquo;s assume though your proposal succeeded.</p></li>
|
||
|
||
<li><p>Implement your idea.</p>
|
||
|
||
<p>Implementation uses all the standard practices of any contribution.</p>
|
||
|
||
<ul>
|
||
<li>fork <code>docker/docker</code></li>
|
||
<li>create a feature branch</li>
|
||
<li>sync frequently back to master</li>
|
||
<li>test as you go and full test before a PR</li>
|
||
</ul>
|
||
|
||
<p>If you run into issues, the community is there to help.</p></li>
|
||
|
||
<li><p>When you have a complete implementation, submit a pull request back to <code>docker/docker</code>.</p></li>
|
||
|
||
<li><p>Review and iterate on your code.</p>
|
||
|
||
<p>If you are making a large code change, you can expect greater scrutiny
|
||
during this phase.</p></li>
|
||
|
||
<li><p>Acceptance and merge!</p></li>
|
||
</ol>
|
||
|
||
<h2 id="about-the-advanced-process">About the advanced process</h2>
|
||
|
||
<p>Docker is a large project. Our core team gets a great many design proposals.
|
||
Design proposal discussions can span days, weeks, and longer. The number of comments can reach the 100s.
|
||
In that situation, following the discussion flow and the decisions reached is crucial.</p>
|
||
|
||
<p>Making a pull request with a design proposal simplifies this process:
|
||
* you can leave comments on specific design proposal line
|
||
* replies around line are easy to track
|
||
* as a proposal changes and is updated, pages reset as line items resolve
|
||
* Github maintains the entire history</p>
|
||
|
||
<p>While proposals in pull requests do not end up merged into a master repository, they provide a convenient tool for managing the design process.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Coding style checklist</title>
|
||
<link>http://localhost/project/coding-style/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/coding-style/</guid>
|
||
<description>
|
||
|
||
<h1 id="coding-style-checklist">Coding style checklist</h1>
|
||
|
||
<p>This checklist summarizes the material you experienced working through <a href="http://localhost/project/project/project/make-a-contribution">make a
|
||
code contribution</a> and <a href="http://localhost/project/project/project/advanced-contributing">advanced
|
||
contributing</a>. The checklist applies to both
|
||
program code and documentation code.</p>
|
||
|
||
<h2 id="change-and-commit-code">Change and commit code</h2>
|
||
|
||
<ul>
|
||
<li><p>Fork the <code>docker/docker</code> repository.</p></li>
|
||
|
||
<li><p>Make changes on your fork in a feature branch. Name your branch <code>XXXX-something</code>
|
||
where <code>XXXX</code> is the issue number you are working on.</p></li>
|
||
|
||
<li><p>Run <code>gofmt -s -w file.go</code> on each changed file before
|
||
committing your changes. Most editors have plug-ins that do this automatically.</p></li>
|
||
|
||
<li><p>Update the documentation when creating or modifying features.</p></li>
|
||
|
||
<li><p>Commits that fix or close an issue should reference them in the commit message
|
||
<code>Closes #XXXX</code> or <code>Fixes #XXXX</code>. Mentions help by automatically closing the
|
||
issue on a merge.</p></li>
|
||
|
||
<li><p>After every commit, run the test suite and ensure it is passing.</p></li>
|
||
|
||
<li><p>Sync and rebase frequently as you code to keep up with <code>docker</code> master.</p></li>
|
||
|
||
<li><p>Set your <code>git</code> signature and make sure you sign each commit.</p></li>
|
||
|
||
<li><p>Do not add yourself to the <code>AUTHORS</code> file. This file is autogenerated from the
|
||
Git history.</p></li>
|
||
</ul>
|
||
|
||
<h2 id="tests-and-testing">Tests and testing</h2>
|
||
|
||
<ul>
|
||
<li><p>Submit unit tests for your changes.</p></li>
|
||
|
||
<li><p>Make use of the builtin Go test framework built.</p></li>
|
||
|
||
<li><p>Use existing Docker test files (<code>name_test.go</code>) for inspiration.</p></li>
|
||
|
||
<li><p>Run <a href="../test-and-docs" target="_blank">the full test suite</a> on your
|
||
branch before submitting a pull request.</p></li>
|
||
|
||
<li><p>Run <code>make docs</code> to build the documentation and then check it locally.</p></li>
|
||
|
||
<li><p>Use an <a href="http://www.hemingwayapp.com" target="_blank">online grammar
|
||
checker</a> or similar to test you documentation changes for clarity,
|
||
concision, and correctness.</p></li>
|
||
</ul>
|
||
|
||
<h2 id="pull-requests">Pull requests</h2>
|
||
|
||
<ul>
|
||
<li><p>Sync and cleanly rebase on top of Docker&rsquo;s <code>master</code> without multiple branches
|
||
mixed into the PR.</p></li>
|
||
|
||
<li><p>Before the pull request, squash your commits into logical units of work using
|
||
<code>git rebase -i</code> and <code>git push -f</code>.</p></li>
|
||
|
||
<li><p>Include documentation changes in the same commit so that a revert would
|
||
remove all traces of the feature or fix.</p></li>
|
||
|
||
<li><p>Reference each issue in your pull request description (<code>#XXXX</code>)</p></li>
|
||
</ul>
|
||
|
||
<h2 id="respond-to-pull-requests-reviews">Respond to pull requests reviews</h2>
|
||
|
||
<ul>
|
||
<li><p>Docker maintainers use LGTM (<strong>l</strong>ooks-<strong>g</strong>ood-<strong>t</strong>o-<strong>m</strong>e) in PR comments
|
||
to indicate acceptance.</p></li>
|
||
|
||
<li><p>Code review comments may be added to your pull request. Discuss, then make
|
||
the suggested modifications and push additional commits to your feature
|
||
branch.</p></li>
|
||
|
||
<li><p>Incorporate changes on your feature branch and push to your fork. This
|
||
automatically updates your open pull request.</p></li>
|
||
|
||
<li><p>Post a comment after pushing to alert reviewers to PR changes; pushing a
|
||
change does not send notifications.</p></li>
|
||
|
||
<li><p>A change requires LGTMs from an absolute majority maintainers of an
|
||
affected component. For example, if you change <code>docs/</code> and <code>registry/</code> code,
|
||
an absolute majority of the <code>docs/</code> and the <code>registry/</code> maintainers must
|
||
approve your PR.</p></li>
|
||
</ul>
|
||
|
||
<h2 id="merges-after-pull-requests">Merges after pull requests</h2>
|
||
|
||
<ul>
|
||
<li><p>After a merge, <a href="https://master.dockerproject.org/">a master build</a> is
|
||
available almost immediately.</p></li>
|
||
|
||
<li><p>If you made a documentation change, you can see it at
|
||
<a href="http://docs.master.dockerproject.org/">docs.master.dockerproject.org</a>.</p></li>
|
||
</ul>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Configure Git for contributing</title>
|
||
<link>http://localhost/project/set-up-git/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/set-up-git/</guid>
|
||
<description>
|
||
|
||
<h1 id="configure-git-for-contributing">Configure Git for contributing</h1>
|
||
|
||
<p>Work through this page to configure Git and a repository you&rsquo;ll use throughout
|
||
the Contributor Guide. The work you do further in the guide, depends on the work
|
||
you do here.</p>
|
||
|
||
<h2 id="fork-and-clone-the-docker-code">Fork and clone the Docker code</h2>
|
||
|
||
<p>Before contributing, you first fork the Docker code repository. A fork copies
|
||
a repository at a particular point in time. GitHub tracks for you where a fork
|
||
originates.</p>
|
||
|
||
<p>As you make contributions, you change your fork&rsquo;s code. When you are ready,
|
||
you make a pull request back to the original Docker repository. If you aren&rsquo;t
|
||
familiar with this workflow, don&rsquo;t worry, this guide walks you through all the
|
||
steps.</p>
|
||
|
||
<p>To fork and clone Docker:</p>
|
||
|
||
<ol>
|
||
<li><p>Open a browser and log into GitHub with your account.</p></li>
|
||
|
||
<li><p>Go to the <a href="https://github.com/docker/docker"
|
||
target="_blank">docker/docker repository</a>.</p></li>
|
||
|
||
<li><p>Click the &ldquo;Fork&rdquo; button in the upper right corner of the GitHub interface.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/fork_docker.png" alt="Branch Signature" />
|
||
</p>
|
||
|
||
<p>GitHub forks the repository to your GitHub account. The original
|
||
<code>docker/docker</code> repository becomes a new fork <code>YOUR_ACCOUNT/docker</code> under
|
||
your account.</p></li>
|
||
|
||
<li><p>Copy your fork&rsquo;s clone URL from GitHub.</p>
|
||
|
||
<p>GitHub allows you to use HTTPS or SSH protocols for clones. You can use the
|
||
<code>git</code> command line or clients like Subversion to clone a repository.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/copy_url.png" alt="Copy clone URL" />
|
||
</p>
|
||
|
||
<p>This guide assume you are using the HTTPS protocol and the <code>git</code> command
|
||
line. If you are comfortable with SSH and some other tool, feel free to use
|
||
that instead. You&rsquo;ll need to convert what you see in the guide to what is
|
||
appropriate to your tool.</p></li>
|
||
|
||
<li><p>Open a terminal window on your local host and change to your home directory.</p>
|
||
|
||
<pre><code>$ cd ~
|
||
</code></pre></li>
|
||
</ol>
|
||
|
||
<p>In Windows, you&rsquo;ll work in your Boot2Docker window instead of Powershell or
|
||
a <code>cmd</code> window.</p>
|
||
|
||
<ol>
|
||
<li><p>Create a <code>repos</code> directory.</p>
|
||
|
||
<pre><code>$ mkdir repos
|
||
</code></pre></li>
|
||
|
||
<li><p>Change into your <code>repos</code> directory.</p>
|
||
|
||
<pre><code>$ cd repos
|
||
</code></pre></li>
|
||
|
||
<li><p>Clone the fork to your local host into a repository called <code>docker-fork</code>.</p>
|
||
|
||
<pre><code>$ git clone https://github.com/moxiegirl/docker.git docker-fork
|
||
</code></pre>
|
||
|
||
<p>Naming your local repo <code>docker-fork</code> should help make these instructions
|
||
easier to follow; experienced coders don&rsquo;t typically change the name.</p></li>
|
||
|
||
<li><p>Change directory into your new <code>docker-fork</code> directory.</p>
|
||
|
||
<pre><code>$ cd docker-fork
|
||
</code></pre>
|
||
|
||
<p>Take a moment to familiarize yourself with the repository&rsquo;s contents. List
|
||
the contents.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="set-your-signature-and-an-upstream-remote">Set your signature and an upstream remote</h2>
|
||
|
||
<p>When you contribute to Docker, you must certify you agree with the
|
||
<a href="http://developercertificate.org/" target="_blank">Developer Certificate of Origin</a>.
|
||
You indicate your agreement by signing your <code>git</code> commits like this:</p>
|
||
|
||
<pre><code>Signed-off-by: Pat Smith &lt;pat.smith@email.com&gt;
|
||
</code></pre>
|
||
|
||
<p>To create a signature, you configure your username and email address in Git.
|
||
You can set these globally or locally on just your <code>docker-fork</code> repository.
|
||
You must sign with your real name. We don&rsquo;t accept anonymous contributions or
|
||
contributions through pseudonyms.</p>
|
||
|
||
<p>As you change code in your fork, you&rsquo;ll want to keep it in sync with the changes
|
||
others make in the <code>docker/docker</code> repository. To make syncing easier, you&rsquo;ll
|
||
also add a <em>remote</em> called <code>upstream</code> that points to <code>docker/docker</code>. A remote
|
||
is just another project version hosted on the internet or network.</p>
|
||
|
||
<p>To configure your username, email, and add a remote:</p>
|
||
|
||
<ol>
|
||
<li><p>Change to the root of your <code>docker-fork</code> repository.</p>
|
||
|
||
<pre><code>$ cd docker-fork
|
||
</code></pre></li>
|
||
|
||
<li><p>Set your <code>user.name</code> for the repository.</p>
|
||
|
||
<pre><code>$ git config --local user.name &quot;FirstName LastName&quot;
|
||
</code></pre></li>
|
||
|
||
<li><p>Set your <code>user.email</code> for the repository.</p>
|
||
|
||
<pre><code>$ git config --local user.email &quot;emailname@mycompany.com&quot;
|
||
</code></pre></li>
|
||
|
||
<li><p>Set your local repo to track changes upstream, on the <code>docker</code> repository.</p>
|
||
|
||
<pre><code>$ git remote add upstream https://github.com/docker/docker.git
|
||
</code></pre></li>
|
||
|
||
<li><p>Check the result in your <code>git</code> configuration.</p>
|
||
|
||
<pre><code>$ git config --local -l
|
||
core.repositoryformatversion=0
|
||
core.filemode=true
|
||
core.bare=false
|
||
core.logallrefupdates=true
|
||
remote.origin.url=https://github.com/moxiegirl/docker.git
|
||
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
|
||
branch.master.remote=origin
|
||
branch.master.merge=refs/heads/master
|
||
user.name=Mary Anthony
|
||
user.email=mary@docker.com
|
||
remote.upstream.url=https://github.com/docker/docker.git
|
||
remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/*
|
||
</code></pre>
|
||
|
||
<p>To list just the remotes use:</p>
|
||
|
||
<pre><code>$ git remote -v
|
||
origin https://github.com/moxiegirl/docker.git (fetch)
|
||
origin https://github.com/moxiegirl/docker.git (push)
|
||
upstream https://github.com/docker/docker.git (fetch)
|
||
upstream https://github.com/docker/docker.git (push)
|
||
</code></pre></li>
|
||
</ol>
|
||
|
||
<h2 id="create-and-push-a-branch">Create and push a branch</h2>
|
||
|
||
<p>As you change code in your fork, make your changes on a repository branch.
|
||
The branch name should reflect what you are working on. In this section, you
|
||
create a branch, make a change, and push it up to your fork.</p>
|
||
|
||
<p>This branch is just for testing your config for this guide. The changes are part
|
||
of a dry run, so the branch name will be dry-run-test. To create and push
|
||
the branch to your fork on GitHub:</p>
|
||
|
||
<ol>
|
||
<li><p>Open a terminal and go to the root of your <code>docker-fork</code>.</p>
|
||
|
||
<pre><code>$ cd docker-fork
|
||
</code></pre></li>
|
||
|
||
<li><p>Create a <code>dry-run-test</code> branch.</p>
|
||
|
||
<pre><code>$ git checkout -b dry-run-test
|
||
</code></pre>
|
||
|
||
<p>This command creates the branch and switches the repository to it.</p></li>
|
||
|
||
<li><p>Verify you are in your new branch.</p>
|
||
|
||
<pre><code>$ git branch
|
||
* dry-run-test
|
||
master
|
||
</code></pre>
|
||
|
||
<p>The current branch has an * (asterisk) marker. So, these results shows you
|
||
are on the right branch.</p></li>
|
||
|
||
<li><p>Create a <code>TEST.md</code> file in the repository&rsquo;s root.</p>
|
||
|
||
<pre><code>$ touch TEST.md
|
||
</code></pre></li>
|
||
|
||
<li><p>Edit the file and add your email and location.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/contributor-edit.png" alt="Add your information" />
|
||
</p>
|
||
|
||
<p>You can use any text editor you are comfortable with.</p></li>
|
||
|
||
<li><p>Save and close the file.</p></li>
|
||
|
||
<li><p>Check the status of your branch.</p>
|
||
|
||
<pre><code>$ git status
|
||
On branch dry-run-test
|
||
Untracked files:
|
||
(use &quot;git add &lt;file&gt;...&quot; to include in what will be committed)
|
||
|
||
|
||
TEST.md
|
||
|
||
|
||
nothing added to commit but untracked files present (use &quot;git add&quot; to track)
|
||
</code></pre>
|
||
|
||
<p>You&rsquo;ve only changed the one file. It is untracked so far by git.</p></li>
|
||
|
||
<li><p>Add your file.</p>
|
||
|
||
<pre><code>$ git add TEST.md
|
||
</code></pre>
|
||
|
||
<p>That is the only <em>staged</em> file. Stage is fancy word for work that Git is
|
||
tracking.</p></li>
|
||
|
||
<li><p>Sign and commit your change.</p>
|
||
|
||
<pre><code>$ git commit -s -m &quot;Making a dry run test.&quot;
|
||
[dry-run-test 6e728fb] Making a dry run test
|
||
1 file changed, 1 insertion(+)
|
||
create mode 100644 TEST.md
|
||
</code></pre>
|
||
|
||
<p>Commit messages should have a short summary sentence of no more than 50
|
||
characters. Optionally, you can also include a more detailed explanation
|
||
after the summary. Separate the summary from any explanation with an empty
|
||
line.</p></li>
|
||
|
||
<li><p>Push your changes to GitHub.</p>
|
||
|
||
<pre><code>$ git push --set-upstream origin dry-run-test
|
||
Username for 'https://github.com': moxiegirl
|
||
Password for 'https://moxiegirl@github.com':
|
||
</code></pre>
|
||
|
||
<p>Git prompts you for your GitHub username and password. Then, the command
|
||
returns a result.</p>
|
||
|
||
<pre><code>Counting objects: 13, done.
|
||
Compressing objects: 100% (2/2), done.
|
||
Writing objects: 100% (3/3), 320 bytes | 0 bytes/s, done.
|
||
Total 3 (delta 1), reused 0 (delta 0)
|
||
To https://github.com/moxiegirl/docker.git
|
||
* [new branch] dry-run-test -&gt; dry-run-test
|
||
Branch dry-run-test set up to track remote branch dry-run-test from origin.
|
||
</code></pre></li>
|
||
|
||
<li><p>Open your browser to Github.</p></li>
|
||
|
||
<li><p>Navigate to your Docker fork.</p></li>
|
||
|
||
<li><p>Make sure the <code>dry-run-test</code> branch exists, that it has your commit, and the
|
||
commit is signed.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/branch-sig.png" alt="Branch Signature" />
|
||
</p></li>
|
||
</ol>
|
||
|
||
<h2 id="where-to-go-next">Where to go next</h2>
|
||
|
||
<p>Congratulations, you have finished configuring both your local host environment
|
||
and Git for contributing. In the next section you&rsquo;ll <a href="http://localhost/project/project/project/set-up-dev-env/">learn how to set up and
|
||
work in a Docker development container</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Create a pull request (PR)</title>
|
||
<link>http://localhost/project/create-pr/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/create-pr/</guid>
|
||
<description>
|
||
|
||
<h1 id="create-a-pull-request-pr">Create a pull request (PR)</h1>
|
||
|
||
<p>A pull request (PR) sends your changes to the Docker maintainers for review. You
|
||
create a pull request on GitHub. A pull request &ldquo;pulls&rdquo; changes from your forked
|
||
repository into the <code>docker/docker</code> repository.</p>
|
||
|
||
<p>You can see <a href="https://github.com/docker/docker/pulls" target="_blank">the
|
||
list of active pull requests to Docker</a> on GitHub.</p>
|
||
|
||
<h2 id="check-your-work">Check your work</h2>
|
||
|
||
<p>Before you create a pull request, check your work.</p>
|
||
|
||
<ol>
|
||
<li><p>In a terminal window, go to the root of your <code>docker-fork</code> repository.</p>
|
||
|
||
<pre><code>$ cd ~/repos/docker-fork
|
||
</code></pre></li>
|
||
|
||
<li><p>Checkout your feature branch.</p>
|
||
|
||
<pre><code>$ git checkout 11038-fix-rhel-link
|
||
Switched to branch '11038-fix-rhel-link'
|
||
</code></pre></li>
|
||
|
||
<li><p>Run the full test suite on your branch.</p>
|
||
|
||
<pre><code>$ make test
|
||
</code></pre>
|
||
|
||
<p>All the tests should pass. If they don&rsquo;t, find out why and correct the
|
||
situation.</p></li>
|
||
|
||
<li><p>Optionally, if modified the documentation, build the documentation:</p>
|
||
|
||
<pre><code>$ make docs
|
||
</code></pre></li>
|
||
|
||
<li><p>Commit and push any changes that result from your checks.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="rebase-your-branch">Rebase your branch</h2>
|
||
|
||
<p>Always rebase and squash your commits before making a pull request.</p>
|
||
|
||
<ol>
|
||
<li><p>Checkout your feature branch in your local <code>docker-fork</code> repository.</p>
|
||
|
||
<p>This is the branch associated with your request.</p></li>
|
||
|
||
<li><p>Fetch any last minute changes from <code>docker/docker</code>.</p>
|
||
|
||
<pre><code>$ git fetch upstream master
|
||
From github.com:docker/docker
|
||
* branch master -&gt; FETCH_HEAD
|
||
</code></pre></li>
|
||
|
||
<li><p>Start an interactive rebase.</p>
|
||
|
||
<pre><code>$ git rebase -i upstream/master
|
||
</code></pre></li>
|
||
|
||
<li><p>Rebase opens an editor with a list of commits.</p>
|
||
|
||
<pre><code>pick 1a79f55 Tweak some of the other text for grammar
|
||
pick 53e4983 Fix a link
|
||
pick 3ce07bb Add a new line about RHEL
|
||
</code></pre></li>
|
||
|
||
<li><p>Replace the <code>pick</code> keyword with <code>squash</code> on all but the first commit.</p>
|
||
|
||
<pre><code>pick 1a79f55 Tweak some of the other text for grammar
|
||
squash 53e4983 Fix a link
|
||
squash 3ce07bb Add a new line about RHEL
|
||
</code></pre>
|
||
|
||
<p>After you save the changes and quit from the editor, git starts
|
||
the rebase, reporting the progress along the way. Sometimes
|
||
your changes can conflict with the work of others. If git
|
||
encounters a conflict, it stops the rebase, and prints guidance
|
||
for how to correct the conflict.</p></li>
|
||
|
||
<li><p>Edit and save your commit message.</p>
|
||
|
||
<pre><code>$ git commit -s
|
||
</code></pre>
|
||
|
||
<p>Make sure your message includes <a href="../set-up-git" target="_blank">your signature</a>.</p></li>
|
||
|
||
<li><p>Force push any changes to your fork on GitHub.</p>
|
||
|
||
<pre><code>$ git push -f origin 11038-fix-rhel-link
|
||
</code></pre></li>
|
||
</ol>
|
||
|
||
<h2 id="create-a-pr-on-github">Create a PR on GitHub</h2>
|
||
|
||
<p>You create and manage PRs on GitHub:</p>
|
||
|
||
<ol>
|
||
<li><p>Open your browser to your fork on GitHub.</p>
|
||
|
||
<p>You should see the latest activity from your branch.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/latest_commits.png" alt="Latest commits" />
|
||
</p></li>
|
||
|
||
<li><p>Click &ldquo;Compare &amp; pull request.&rdquo;</p>
|
||
|
||
<p>The system displays the pull request dialog.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/to_from_pr.png" alt="PR dialog" />
|
||
</p>
|
||
|
||
<p>The pull request compares your changes to the <code>master</code> branch on the
|
||
<code>docker/docker</code> repository.</p></li>
|
||
|
||
<li><p>Edit the dialog&rsquo;s description and add a reference to the issue you are fixing.</p>
|
||
|
||
<p>GitHub helps you out by searching for the issue as you type.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/fixes_num.png" alt="Fixes issue" />
|
||
</p></li>
|
||
|
||
<li><p>Scroll down and verify the PR contains the commits and changes you expect.</p>
|
||
|
||
<p>For example, is the file count correct? Are the changes in the files what
|
||
you expect?</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/commits_expected.png" alt="Commits" />
|
||
</p></li>
|
||
|
||
<li><p>Press &ldquo;Create pull request&rdquo;.</p>
|
||
|
||
<p>The system creates the request and opens it for you in the <code>docker/docker</code>
|
||
repository.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/pull_request_made.png" alt="Pull request made" />
|
||
</p></li>
|
||
</ol>
|
||
|
||
<h2 id="where-to-go-next">Where to go next</h2>
|
||
|
||
<p>Congratulations, you&rsquo;ve created your first pull request to Docker. The next
|
||
step is for you learn how to <a href="http://localhost/project/project/project/review-pr/">participate in your PR&rsquo;s
|
||
review</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Find and claim an issue</title>
|
||
<link>http://localhost/project/find-an-issue/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/find-an-issue/</guid>
|
||
<description>
|
||
|
||
<p><style type="text/css"></p>
|
||
|
||
<p>/* GitHub label styles */
|
||
.gh-label {
|
||
display: inline-block;
|
||
padding: 3px 4px;
|
||
font-size: 12px;
|
||
font-weight: bold;
|
||
line-height: 1;
|
||
color: #fff;
|
||
border-radius: 2px;
|
||
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.12);
|
||
}</p>
|
||
|
||
<p>/* Experience */
|
||
.gh-label.beginner { background-color: #B5E0B5; color: #333333; }
|
||
.gh-label.expert { background-color: #599898; color: #ffffff; }
|
||
.gh-label.master { background-color: #306481; color: #ffffff; }
|
||
.gh-label.novice { background-color: #D6F2AC; color: #333333; }
|
||
.gh-label.proficient { background-color: #8DC7A9; color: #333333; }</p>
|
||
|
||
<p>/* Kind */
|
||
.gh-label.bug { background-color: #FF9DA4; color: #333333; }
|
||
.gh-label.cleanup { background-color: #FFB7B3; color: #333333; }
|
||
.gh-label.content { background-color: #CDD3C2; color: #333333; }
|
||
.gh-label.feature { background-color: #B7BEB7; color: #333333; }
|
||
.gh-label.graphics { background-color: #E1EFCB; color: #333333; }
|
||
.gh-label.improvement { background-color: #EBD2BB; color: #333333; }
|
||
.gh-label.proposal { background-color: #FFD9C0; color: #333333; }
|
||
.gh-label.question { background-color: #EEF1D1; color: #333333; }
|
||
.gh-label.usecase { background-color: #F0E4C2; color: #333333; }
|
||
.gh-label.writing { background-color: #B5E9D5; color: #333333; }</p>
|
||
|
||
<p></style></p>
|
||
|
||
<h1 id="find-and-claim-an-issue">Find and claim an issue</h1>
|
||
|
||
<p>On this page, you choose what you want to work on. As a contributor you can work
|
||
on whatever you want. If you are new to contributing, you should start by
|
||
working with our known issues.</p>
|
||
|
||
<h2 id="understand-the-issue-types">Understand the issue types</h2>
|
||
|
||
<p>An existing issue is something reported by a Docker user. As issues come in,
|
||
our maintainers triage them. Triage is its own topic. For now, it is important
|
||
for you to know that triage includes ranking issues according to difficulty.</p>
|
||
|
||
<p>Triaged issues have one of these labels:</p>
|
||
|
||
<table class="tg">
|
||
<tr>
|
||
<td class="tg-031e">Level</td>
|
||
<td class="tg-031e">Experience level guideline</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="tg-031e"><strong class="gh-label beginner">exp/beginner</strong></td>
|
||
<td class="tg-031e">You have made less than 10 contributions in your life time to any open source project.</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="tg-031e"><strong class="gh-label novice">exp/novice</strong></td>
|
||
<td class="tg-031e">You have made more than 10 contributions to an open source project or at least 5 contributions to Docker. </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="tg-031e"><strong class="gh-label proficient">exp/proficient</strong></td>
|
||
<td class="tg-031e">You have made more than 5 contributions to Docker which amount to at least 200 code lines or 1000 documentation lines. </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="tg-031e"><strong class="gh-label expert">exp/expert</strong></td>
|
||
<td class="tg-031e">You have made less than 20 commits to Docker which amount to 500-1000 code lines or 1000-3000 documentation lines. </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="tg-031e"><strong class="gh-label master">exp/master</strong></td>
|
||
<td class="tg-031e">You have made more than 20 commits to Docker and greater than 1000 code lines or 3000 documentation lines.</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<p>As the table states, these labels are meant as guidelines. You might have
|
||
written a whole plugin for Docker in a personal project and never contributed to
|
||
Docker. With that kind of experience, you could take on an <strong
|
||
class="gh-label expert">exp/expert</strong> or <strong class="gh-label
|
||
master">exp/master</strong> level task.</p>
|
||
|
||
<h2 id="claim-a-beginner-or-novice-issue">Claim a beginner or novice issue</h2>
|
||
|
||
<p>In this section, you find and claim an open documentation lines issue.</p>
|
||
|
||
<ol>
|
||
<li><p>Go to the <code>docker/docker</code> <a
|
||
href="https://github.com/docker/docker" target="_blank">repository</a>.</p></li>
|
||
|
||
<li><p>Click on the &ldquo;Issues&rdquo; link.</p>
|
||
|
||
<p>A list of the open issues appears.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/issue_list.png" alt="Open issues" />
|
||
</p></li>
|
||
|
||
<li><p>Look for the <strong class="gh-label beginner">exp/beginner</strong> items on the list.</p></li>
|
||
|
||
<li><p>Click on the &ldquo;labels&rdquo; dropdown and select <strong class="gh-label beginner">exp/beginner</strong>.</p>
|
||
|
||
<p>The system filters to show only open <strong class="gh-label beginner">exp/beginner</strong> issues.</p></li>
|
||
|
||
<li><p>Open an issue that interests you.</p>
|
||
|
||
<p>The comments on the issues can tell you both the problem and the potential
|
||
solution.</p></li>
|
||
|
||
<li><p>Make sure that no other user has chosen to work on the issue.</p>
|
||
|
||
<p>We don&rsquo;t allow external contributors to assign issues to themselves. So, you
|
||
need to read the comments to find if a user claimed the issue by leaving a
|
||
<code>#dibs</code> comment on the issue.</p></li>
|
||
|
||
<li><p>When you find an open issue that both interests you and is unclaimed, add a
|
||
<code>#dibs</code> comment.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/easy_issue.png" alt="Easy issue" />
|
||
</p>
|
||
|
||
<p>This example uses issue 11038. Your issue # will be different depending on
|
||
what you claimed. After a moment, Gordon the Docker bot, changes the issue
|
||
status to claimed.</p></li>
|
||
|
||
<li><p>Make a note of the issue number; you&rsquo;ll need it later.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="sync-your-fork-and-create-a-new-branch">Sync your fork and create a new branch</h2>
|
||
|
||
<p>If you have followed along in this guide, you forked the <code>docker/docker</code>
|
||
repository. Maybe that was an hour ago or a few days ago. In any case, before
|
||
you start working on your issue, sync your repository with the upstream
|
||
<code>docker/docker</code> master. Syncing ensures your repository has the latest
|
||
changes.</p>
|
||
|
||
<p>To sync your repository:</p>
|
||
|
||
<ol>
|
||
<li><p>Open a terminal on your local host.</p></li>
|
||
|
||
<li><p>Change directory to the <code>docker-fork</code> root.</p>
|
||
|
||
<pre><code>$ cd ~/repos/docker-fork
|
||
</code></pre></li>
|
||
|
||
<li><p>Checkout the master branch.</p>
|
||
|
||
<pre><code>$ git checkout master
|
||
Switched to branch 'master'
|
||
Your branch is up-to-date with 'origin/master'.
|
||
</code></pre>
|
||
|
||
<p>Recall that <code>origin/master</code> is a branch on your remote GitHub repository.</p></li>
|
||
|
||
<li><p>Make sure you have the upstream remote <code>docker/docker</code> by listing them.</p>
|
||
|
||
<pre><code>$ git remote -v
|
||
origin https://github.com/moxiegirl/docker.git (fetch)
|
||
origin https://github.com/moxiegirl/docker.git (push)
|
||
upstream https://github.com/docker/docker.git (fetch)
|
||
upstream https://github.com/docker/docker.git (push)
|
||
</code></pre>
|
||
|
||
<p>If the <code>upstream</code> is missing, add it.</p>
|
||
|
||
<pre><code>$ git remote add upstream https://github.com/docker/docker.git
|
||
</code></pre></li>
|
||
|
||
<li><p>Fetch all the changes from the <code>upstream master</code> branch.</p>
|
||
|
||
<pre><code>$ git fetch upstream master
|
||
remote: Counting objects: 141, done.
|
||
remote: Compressing objects: 100% (29/29), done.
|
||
remote: Total 141 (delta 52), reused 46 (delta 46), pack-reused 66
|
||
Receiving objects: 100% (141/141), 112.43 KiB | 0 bytes/s, done.
|
||
Resolving deltas: 100% (79/79), done.
|
||
From github.com:docker/docker
|
||
* branch master -&gt; FETCH_HEAD
|
||
</code></pre>
|
||
|
||
<p>This command says get all the changes from the <code>master</code> branch belonging to
|
||
the <code>upstream</code> remote.</p></li>
|
||
|
||
<li><p>Rebase your local master with the <code>upstream/master</code>.</p>
|
||
|
||
<pre><code>$ git rebase upstream/master
|
||
First, rewinding head to replay your work on top of it...
|
||
Fast-forwarded master to upstream/master.
|
||
</code></pre>
|
||
|
||
<p>This command applies all the commits from the upstream master to your local
|
||
master.</p></li>
|
||
|
||
<li><p>Check the status of your local branch.</p>
|
||
|
||
<pre><code>$ git status
|
||
On branch master
|
||
Your branch is ahead of 'origin/master' by 38 commits.
|
||
(use &quot;git push&quot; to publish your local commits)
|
||
nothing to commit, working directory clean
|
||
</code></pre>
|
||
|
||
<p>Your local repository now has all the changes from the <code>upstream</code> remote. You
|
||
need to push the changes to your own remote fork which is <code>origin master</code>.</p></li>
|
||
|
||
<li><p>Push the rebased master to <code>origin master</code>.</p>
|
||
|
||
<pre><code>$ git push origin master
|
||
Username for 'https://github.com': moxiegirl
|
||
Password for 'https://moxiegirl@github.com':
|
||
Counting objects: 223, done.
|
||
Compressing objects: 100% (38/38), done.
|
||
Writing objects: 100% (69/69), 8.76 KiB | 0 bytes/s, done.
|
||
Total 69 (delta 53), reused 47 (delta 31)
|
||
To https://github.com/moxiegirl/docker.git
|
||
8e107a9..5035fa1 master -&gt; master
|
||
</code></pre></li>
|
||
|
||
<li><p>Create a new feature branch to work on your issue.</p>
|
||
|
||
<p>Your branch name should have the format <code>XXXX-descriptive</code> where <code>XXXX</code> is
|
||
the issue number you are working on. For example:</p>
|
||
|
||
<pre><code>$ git checkout -b 11038-fix-rhel-link
|
||
Switched to a new branch '11038-fix-rhel-link'
|
||
</code></pre>
|
||
|
||
<p>Your branch should be up-to-date with the <code>upstream/master</code>. Why? Because you
|
||
branched off a freshly synced master. Let&rsquo;s check this anyway in the next
|
||
step.</p></li>
|
||
|
||
<li><p>Rebase your branch from upstream/master.</p>
|
||
|
||
<pre><code>$ git rebase upstream/master
|
||
Current branch 11038-fix-rhel-link is up to date.
|
||
</code></pre>
|
||
|
||
<p>At this point, your local branch, your remote repository, and the Docker
|
||
repository all have identical code. You are ready to make changes for your
|
||
issue.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="where-to-go-next">Where to go next</h2>
|
||
|
||
<p>At this point, you know what you want to work on and you have a branch to do
|
||
your work in. Go onto the next section to learn <a href="http://localhost/project/project/project/work-issue/">how to work on your
|
||
changes</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Get the required software</title>
|
||
<link>http://localhost/project/software-required/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/software-required/</guid>
|
||
<description>
|
||
|
||
<h1 id="get-the-required-software-for-linux-or-os-x">Get the required software for Linux or OS X</h1>
|
||
|
||
<p>This page explains how to get the software you need to use a Linux or OS X
|
||
machine for Docker development. Before you begin contributing you must have:</p>
|
||
|
||
<ul>
|
||
<li>a GitHub account</li>
|
||
<li><code>git</code></li>
|
||
<li><code>make</code></li>
|
||
<li><code>docker</code></li>
|
||
</ul>
|
||
|
||
<p>You&rsquo;ll notice that <code>go</code>, the language that Docker is written in, is not listed.
|
||
That&rsquo;s because you don&rsquo;t need it installed; Docker&rsquo;s development environment
|
||
provides it for you. You&rsquo;ll learn more about the development environment later.</p>
|
||
|
||
<h3 id="get-a-github-account">Get a GitHub account</h3>
|
||
|
||
<p>To contribute to the Docker project, you will need a <a
|
||
href="https://github.com" target="_blank">GitHub account</a>. A free account is
|
||
fine. All the Docker project repositories are public and visible to everyone.</p>
|
||
|
||
<p>You should also have some experience using both the GitHub application and <code>git</code>
|
||
on the command line.</p>
|
||
|
||
<h3 id="install-git">Install git</h3>
|
||
|
||
<p>Install <code>git</code> on your local system. You can check if <code>git</code> is on already on your
|
||
system and properly installed with the following command:</p>
|
||
|
||
<pre><code>$ git --version
|
||
</code></pre>
|
||
|
||
<p>This documentation is written using <code>git</code> version 2.2.2. Your version may be
|
||
different depending on your OS.</p>
|
||
|
||
<h3 id="install-make">Install make</h3>
|
||
|
||
<p>Install <code>make</code>. You can check if <code>make</code> is on your system with the following
|
||
command:</p>
|
||
|
||
<pre><code>$ make -v
|
||
</code></pre>
|
||
|
||
<p>This documentation is written using GNU Make 3.81. Your version may be different
|
||
depending on your OS.</p>
|
||
|
||
<h3 id="install-or-upgrade-docker">Install or upgrade Docker</h3>
|
||
|
||
<p>If you haven&rsquo;t already, install the Docker software using the
|
||
<a href="http://localhost/installation" target="_blank">instructions for your operating system</a>.
|
||
If you have an existing installation, check your version and make sure you have
|
||
the latest Docker.</p>
|
||
|
||
<p>To check if <code>docker</code> is already installed on Linux:</p>
|
||
|
||
<pre><code>$ docker --version
|
||
Docker version 1.5.0, build a8a31ef
|
||
</code></pre>
|
||
|
||
<p>On Mac OS X or Windows, you should have installed Boot2Docker which includes
|
||
Docker. You&rsquo;ll need to verify both Boot2Docker and then Docker. This
|
||
documentation was written on OS X using the following versions.</p>
|
||
|
||
<pre><code>$ boot2docker version
|
||
Boot2Docker-cli version: v1.5.0
|
||
Git commit: ccd9032
|
||
|
||
$ docker --version
|
||
Docker version 1.5.0, build a8a31ef
|
||
</code></pre>
|
||
|
||
<h2 id="linux-users-and-sudo">Linux users and sudo</h2>
|
||
|
||
<p>This guide assumes you have added your user to the <code>docker</code> group on your system.
|
||
To check, list the group&rsquo;s contents:</p>
|
||
|
||
<pre><code>$ getent group docker
|
||
docker:x:999:ubuntu
|
||
</code></pre>
|
||
|
||
<p>If the command returns no matches, you have two choices. You can preface this
|
||
guide&rsquo;s <code>docker</code> commands with <code>sudo</code> as you work. Alternatively, you can add
|
||
your user to the <code>docker</code> group as follows:</p>
|
||
|
||
<pre><code>$ sudo usermod -aG docker ubuntu
|
||
</code></pre>
|
||
|
||
<p>You must log out and log back in for this modification to take effect.</p>
|
||
|
||
<h2 id="where-to-go-next">Where to go next</h2>
|
||
|
||
<p>In the next section, you&rsquo;ll <a href="http://localhost/project/project/project/set-up-git/">learn how to set up and configure Git for
|
||
contributing to Docker</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Participate in the PR review</title>
|
||
<link>http://localhost/project/review-pr/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/review-pr/</guid>
|
||
<description>
|
||
|
||
<h1 id="participate-in-the-pr-review">Participate in the PR review</h1>
|
||
|
||
<p>Creating a pull request is nearly the end of the contribution process. At this
|
||
point, your code is reviewed both by our continuous integration (CI) systems and
|
||
by our maintainers.</p>
|
||
|
||
<p>The CI system is an automated system. The maintainers are human beings that also
|
||
work on Docker. You need to understand and work with both the &ldquo;bots&rdquo; and the
|
||
&ldquo;beings&rdquo; to review your contribution.</p>
|
||
|
||
<h2 id="how-we-process-your-review">How we process your review</h2>
|
||
|
||
<p>First to review your pull request is Gordon. Gordon is fast. He checks your
|
||
pull request (PR) for common problems like a missing signature. If Gordon finds a
|
||
problem, he&rsquo;ll send an email through your GitHub user account:</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/gordon.jpeg" alt="Gordon" />
|
||
</p>
|
||
|
||
<p>Our build bot system starts building your changes while Gordon sends any emails.</p>
|
||
|
||
<p>The build system double-checks your work by compiling your code with Docker&rsquo;s master
|
||
code. Building includes running the same tests you ran locally. If you forgot
|
||
to run tests or missed something in fixing problems, the automated build is our
|
||
safety check.</p>
|
||
|
||
<p>After Gordon and the bots, the &ldquo;beings&rdquo; review your work. Docker maintainers look
|
||
at your pull request and comment on it. The shortest comment you might see is
|
||
<code>LGTM</code> which means <strong>l</strong>ooks-<strong>g</strong>ood-<strong>t</strong>o-<strong>m</strong>e. If you get an <code>LGTM</code>, that
|
||
is a good thing, you passed that review.</p>
|
||
|
||
<p>For complex changes, maintainers may ask you questions or ask you to change
|
||
something about your submission. All maintainer comments on a PR go to the
|
||
email address associated with your GitHub account. Any GitHub user who
|
||
&ldquo;participates&rdquo; in a PR receives an email to. Participating means creating or
|
||
commenting on a PR.</p>
|
||
|
||
<p>Our maintainers are very experienced Docker users and open source contributors.
|
||
So, they value your time and will try to work efficiently with you by keeping
|
||
their comments specific and brief. If they ask you to make a change, you&rsquo;ll
|
||
need to update your pull request with additional changes.</p>
|
||
|
||
<h2 id="update-an-existing-pull-request">Update an existing pull request</h2>
|
||
|
||
<p>To update your existing pull request:</p>
|
||
|
||
<ol>
|
||
<li><p>Checkout the PR branch in your local <code>docker-fork</code> repository.</p>
|
||
|
||
<p>This is the branch associated with your request.</p></li>
|
||
|
||
<li><p>Change one or more files and then stage your changes.</p>
|
||
|
||
<p>The command syntax is:</p>
|
||
|
||
<pre><code>git add &lt;path_or_filename&gt;
|
||
</code></pre></li>
|
||
|
||
<li><p>Commit the change.</p>
|
||
|
||
<pre><code>$ git commit --amend
|
||
</code></pre>
|
||
|
||
<p>Git opens an editor containing your last commit message.</p></li>
|
||
|
||
<li><p>Adjust your last comment to reflect this new change.</p>
|
||
|
||
<pre><code>Added a new sentence per Anaud's suggestion
|
||
|
||
|
||
Signed-off-by: Mary Anthony &lt;mary@docker.com&gt;
|
||
|
||
|
||
# Please enter the commit message for your changes. Lines starting
|
||
# with '#' will be ignored, and an empty message aborts the commit.
|
||
# On branch 11038-fix-rhel-link
|
||
# Your branch is up-to-date with 'origin/11038-fix-rhel-link'.
|
||
#
|
||
# Changes to be committed:
|
||
# modified: docs/installation/mac.md
|
||
# modified: docs/installation/rhel.md
|
||
</code></pre></li>
|
||
|
||
<li><p>Force push the change to your origin.</p>
|
||
|
||
<p>The command syntax is:</p>
|
||
|
||
<pre><code>git push -f origin &lt;branch_name&gt;
|
||
</code></pre></li>
|
||
|
||
<li><p>Open your browser to your pull request on GitHub.</p>
|
||
|
||
<p>You should see your pull request now contains your newly pushed code.</p></li>
|
||
|
||
<li><p>Add a comment to your pull request.</p>
|
||
|
||
<p>GitHub only notifies PR participants when you comment. For example, you can
|
||
mention that you updated your PR. Your comment alerts the maintainers that
|
||
you made an update.</p></li>
|
||
</ol>
|
||
|
||
<p>A change requires LGTMs from an absolute majority of an affected component&rsquo;s
|
||
maintainers. For example, if you change <code>docs/</code> and <code>registry/</code> code, an
|
||
absolute majority of the <code>docs/</code> and the <code>registry/</code> maintainers must approve
|
||
your PR. Once you get approval, we merge your pull request into Docker&rsquo;s
|
||
<code>master</code> code branch.</p>
|
||
|
||
<h2 id="after-the-merge">After the merge</h2>
|
||
|
||
<p>It can take time to see a merged pull request in Docker&rsquo;s official release.
|
||
A master build is available almost immediately though. Docker builds and
|
||
updates its development binaries after each merge to <code>master</code>.</p>
|
||
|
||
<ol>
|
||
<li><p>Browse to <a href="https://master.dockerproject.org/" target="_blank"><a href="https://master.dockerproject.org/">https://master.dockerproject.org/</a></a>.</p></li>
|
||
|
||
<li><p>Look for the binary appropriate to your system.</p></li>
|
||
|
||
<li><p>Download and run the binary.</p>
|
||
|
||
<p>You might want to run the binary in a container though. This
|
||
will keep your local host environment clean.</p></li>
|
||
|
||
<li><p>View any documentation changes at <a href="http://docs.master.dockerproject.org/" target="_blank">docs.master.dockerproject.org</a>.</p></li>
|
||
</ol>
|
||
|
||
<p>Once you&rsquo;ve verified everything merged, feel free to delete your feature branch
|
||
from your fork. For information on how to do this,
|
||
<a href="https://help.github.com/articles/deleting-unused-branches/" target="_blank">
|
||
see the GitHub help on deleting branches</a>.</p>
|
||
|
||
<h2 id="where-to-go-next">Where to go next</h2>
|
||
|
||
<p>At this point, you have completed all the basic tasks in our contributors guide.
|
||
If you enjoyed contributing, let us know by completing another beginner
|
||
issue or two. We really appreciate the help.</p>
|
||
|
||
<p>If you are very experienced and want to make a major change, go on to
|
||
<a href="http://localhost/project/project/project/advanced-contributing">learn about advanced contributing</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>README first</title>
|
||
<link>http://localhost/project/who-written-for/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/who-written-for/</guid>
|
||
<description>
|
||
|
||
<h1 id="readme-first">README first</h1>
|
||
|
||
<p>This section of the documentation contains a guide for Docker users who want to
|
||
contribute code or documentation to the Docker project. As a community, we
|
||
share rules of behavior and interaction. Make sure you are familiar with the <a
|
||
href="https://github.com/docker/docker/blob/master/CONTRIBUTING.md#docker-community-guidelines"
|
||
target="_blank">community guidelines</a> before continuing.</p>
|
||
|
||
<h2 id="where-and-what-you-can-contribute">Where and what you can contribute</h2>
|
||
|
||
<p>The Docker project consists of not just one but several repositories on GitHub.
|
||
So, in addition to the <code>docker/docker</code> repository, there is the
|
||
<code>docker/libcontainer</code> repo, the <code>docker/machine</code> repo, and several more.
|
||
Contribute to any of these and you contribute to the Docker project.</p>
|
||
|
||
<p>Not all Docker repositories use the Go language. Also, each repository has its
|
||
own focus area. So, if you are an experienced contributor, think about
|
||
contributing to a Docker repository that has a language or a focus area you are
|
||
familiar with.</p>
|
||
|
||
<p>If you are new to the open source community, to Docker, or to formal
|
||
programming, you should start out contributing to the <code>docker/docker</code>
|
||
repository. Why? Because this guide is written for that repository specifically.</p>
|
||
|
||
<p>Finally, code or documentation isn&rsquo;t the only way to contribute. You can report
|
||
an issue, add to discussions in our community channel, write a blog post, or
|
||
take a usability test. You can even propose your own type of contribution.
|
||
Right now we don&rsquo;t have a lot written about this yet, so just email
|
||
<a href="mailto:feedback@docker.com">feedback@docker.com</a> if this type of contributing interests you.</p>
|
||
|
||
<h2 id="a-turtle-is-involved">A turtle is involved</h2>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/gordon.jpeg" alt="Gordon" />
|
||
</p>
|
||
|
||
<p>Enough said.</p>
|
||
|
||
<h2 id="how-to-use-this-guide">How to use this guide</h2>
|
||
|
||
<p>This is written for the distracted, the overworked, the sloppy reader with fair
|
||
<code>git</code> skills and a failing memory for the GitHub GUI. The guide attempts to
|
||
explain how to use the Docker environment as precisely, predictably, and
|
||
procedurally as possible.</p>
|
||
|
||
<p>Users who are new to the Docker development environment should start by setting
|
||
up their environment. Then, they should try a simple code change. After that,
|
||
you should find something to work on or propose at totally new change.</p>
|
||
|
||
<p>If you are a programming prodigy, you still may find this documentation useful.
|
||
Please feel free to skim past information you find obvious or boring.</p>
|
||
|
||
<h2 id="how-to-get-started">How to get started</h2>
|
||
|
||
<p>Start by <a href="http://localhost/project/project/project/software-required/">getting the software you need to contribute</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Run tests and test documentation</title>
|
||
<link>http://localhost/project/test-and-docs/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/test-and-docs/</guid>
|
||
<description>
|
||
|
||
<h1 id="run-tests-and-test-documentation">Run tests and test documentation</h1>
|
||
|
||
<p>Contributing includes testing your changes. If you change the Docker code, you
|
||
may need to add a new test or modify an existing one. Your contribution could
|
||
even be adding tests to Docker. For this reason, you need to know a little
|
||
about Docker&rsquo;s test infrastructure.</p>
|
||
|
||
<p>Many contributors contribute documentation only. Or, a contributor makes a code
|
||
contribution that changes how Docker behaves and that change needs
|
||
documentation. For these reasons, you also need to know how to build, view, and
|
||
test the Docker documentation.</p>
|
||
|
||
<p>In this section, you run tests in the <code>dry-run-test</code> branch of your Docker
|
||
fork. If you have followed along in this guide, you already have this branch.
|
||
If you don&rsquo;t have this branch, you can create it or simply use another of your
|
||
branches.</p>
|
||
|
||
<h2 id="understand-testing-at-docker">Understand testing at Docker</h2>
|
||
|
||
<p>Docker tests use the Go language&rsquo;s test framework. In this framework, files
|
||
whose names end in <code>_test.go</code> contain test code; you&rsquo;ll find test files like
|
||
this throughout the Docker repo. Use these files for inspiration when writing
|
||
your own tests. For information on Go&rsquo;s test framework, see <a
|
||
href="http://golang.org/pkg/testing/" target="_blank">Go&rsquo;s testing package
|
||
documentation</a> and the <a href="http://golang.org/cmd/go/#hdr-Test_packages"
|
||
target="_blank">go test help</a>.</p>
|
||
|
||
<p>You are responsible for <em>unit testing</em> your contribution when you add new or
|
||
change existing Docker code. A unit test is a piece of code that invokes a
|
||
single, small piece of code ( <em>unit of work</em> ) to verify the unit works as
|
||
expected.</p>
|
||
|
||
<p>Depending on your contribution, you may need to add <em>integration tests</em>. These
|
||
are tests that combine two or more work units into one component. These work
|
||
units each have unit tests and then, together, integration tests that test the
|
||
interface between the components. The <code>integration</code> and <code>integration-cli</code>
|
||
directories in the Docker repository contain integration test code.</p>
|
||
|
||
<p>Testing is its own specialty. If you aren&rsquo;t familiar with testing techniques,
|
||
there is a lot of information available to you on the Web. For now, you should
|
||
understand that, the Docker maintainers may ask you to write a new test or
|
||
change an existing one.</p>
|
||
|
||
<h3 id="run-tests-on-your-local-host">Run tests on your local host</h3>
|
||
|
||
<p>Before submitting any code change, you should run the entire Docker test suite.
|
||
The <code>Makefile</code> contains a target for the entire test suite. The target&rsquo;s name
|
||
is simply <code>test</code>. The make file contains several targets for testing:</p>
|
||
|
||
<p><style type="text/css">
|
||
.monospaced {font-family: Monaco, Consolas, &ldquo;Lucida Console&rdquo;, monospace !important;}
|
||
</style>
|
||
<table>
|
||
<tr>
|
||
<th>Target</th>
|
||
<th>What this target does</th>
|
||
</tr>
|
||
<tr>
|
||
<td class="monospaced">test</td>
|
||
<td>Run all the tests.</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="monospaced">test-unit</td>
|
||
<td>Run just the unit tests.</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="monospaced">test-integration-cli</td>
|
||
<td>Run the test for the integration command line interface.</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="monospaced">test-docker-py</td>
|
||
<td>Run the tests for Docker API client.</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="monospaced">docs-test</td>
|
||
<td>Runs the documentation test build.</td>
|
||
</tr>
|
||
</table></p>
|
||
|
||
<p>Run the entire test suite on your current repository:</p>
|
||
|
||
<ol>
|
||
<li><p>Open a terminal on your local host.</p></li>
|
||
|
||
<li><p>Change to the root your Docker repository.</p>
|
||
|
||
<pre><code>$ cd docker-fork
|
||
</code></pre></li>
|
||
|
||
<li><p>Make sure you are in your development branch.</p>
|
||
|
||
<pre><code>$ git checkout dry-run-test
|
||
</code></pre></li>
|
||
|
||
<li><p>Run the <code>make test</code> command.</p>
|
||
|
||
<pre><code>$ make test
|
||
</code></pre>
|
||
|
||
<p>This command does several things, it creates a container temporarily for
|
||
testing. Inside that container, the <code>make</code>:</p>
|
||
|
||
<ul>
|
||
<li>creates a new binary</li>
|
||
<li>cross-compiles all the binaries for the various operating systems</li>
|
||
<li>runs all the tests in the system</li>
|
||
</ul>
|
||
|
||
<p>It can take several minutes to run all the tests. When they complete
|
||
successfully, you see the output concludes with something like this:</p>
|
||
|
||
<pre><code>[PASSED]: top - sleep process should be listed in privileged mode
|
||
[PASSED]: version - verify that it works and that the output is properly formatted
|
||
PASS
|
||
coverage: 70.8% of statements
|
||
---&gt; Making bundle: test-docker-py (in bundles/1.5.0-dev/test-docker-py)
|
||
+++ exec docker --daemon --debug --host unix:///go/src/github.com/docker/docker/bundles/1.5.0-dev/test-docker-py/docker.sock --storage-driver vfs --exec-driver native --pidfile /go/src/github.com/docker/docker/bundles/1.5.0-dev/test-docker-py/docker.pid
|
||
.................................................................
|
||
----------------------------------------------------------------------
|
||
Ran 65 tests in 89.266s
|
||
</code></pre></li>
|
||
</ol>
|
||
|
||
<h3 id="run-test-targets-inside-the-development-container">Run test targets inside the development container</h3>
|
||
|
||
<p>If you are working inside a Docker development container, you use the
|
||
<code>hack/make.sh</code> script to run tests. The <code>hack/make.sh</code> script doesn&rsquo;t
|
||
have a single target that runs all the tests. Instead, you provide a single
|
||
command line with multiple targets that does the same thing.</p>
|
||
|
||
<p>Try this now.</p>
|
||
|
||
<ol>
|
||
<li><p>Open a terminal and change to the <code>docker-fork</code> root.</p></li>
|
||
|
||
<li><p>Start a Docker development image.</p>
|
||
|
||
<p>If you are following along with this guide, you should have a
|
||
<code>dry-run-test</code> image.</p>
|
||
|
||
<pre><code>$ docker run --privileged --rm -ti -v `pwd`:/go/src/github.com/docker/docker dry-run-test /bin/bash
|
||
</code></pre></li>
|
||
|
||
<li><p>Run the tests using the <code>hack/make.sh</code> script.</p>
|
||
|
||
<pre><code>root@5f8630b873fe:/go/src/github.com/docker/docker# hack/make.sh dynbinary binary cross test-unit test-integration-cli test-docker-py
|
||
</code></pre>
|
||
|
||
<p>The tests run just as they did within your local host.</p></li>
|
||
</ol>
|
||
|
||
<p>Of course, you can also run a subset of these targets too. For example, to run
|
||
just the unit tests:</p>
|
||
|
||
<pre><code>root@5f8630b873fe:/go/src/github.com/docker/docker# hack/make.sh dynbinary binary cross test-unit
|
||
</code></pre>
|
||
|
||
<p>Most test targets require that you build these precursor targets first:
|
||
<code>dynbinary binary cross</code></p>
|
||
|
||
<h2 id="running-individual-or-multiple-named-tests">Running individual or multiple named tests</h2>
|
||
|
||
<p>We use <a href="https://labix.org/gocheck">gocheck</a> for our integration-cli tests.
|
||
You can use the <code>TESTFLAGS</code> environment variable to run a single test. The
|
||
flag&rsquo;s value is passed as arguments to the <code>go test</code> command. For example, from
|
||
your local host you can run the <code>TestBuild</code> test with this command:</p>
|
||
|
||
<pre><code>$ TESTFLAGS='-check.f DockerSuite.TestBuild*' make test-integration-cli
|
||
</code></pre>
|
||
|
||
<p>To run the same test inside your Docker development container, you do this:</p>
|
||
|
||
<pre><code>root@5f8630b873fe:/go/src/github.com/docker/docker# TESTFLAGS='-check.f TestBuild*' hack/make.sh binary test-integration-cli
|
||
</code></pre>
|
||
|
||
<h2 id="if-tests-under-boot2docker-fail-due-to-disk-space-errors">If tests under Boot2Docker fail due to disk space errors</h2>
|
||
|
||
<p>Running the tests requires about 2GB of memory. If you are running your
|
||
container on bare metal, that is you are not running with Boot2Docker, your
|
||
Docker development container is able to take the memory it requires directly
|
||
from your local host.</p>
|
||
|
||
<p>If you are running Docker using Boot2Docker, the VM uses 2048MB by default.
|
||
This means you can exceed the memory of your VM running tests in a Boot2Docker
|
||
environment. When the test suite runs out of memory, it returns errors similar
|
||
to the following:</p>
|
||
|
||
<pre><code>server.go:1302 Error: Insertion failed because database is full: database or
|
||
disk is full
|
||
|
||
utils_test.go:179: Error copy: exit status 1 (cp: writing
|
||
'/tmp/docker-testd5c9-[...]': No space left on device
|
||
</code></pre>
|
||
|
||
<p>To increase the memory on your VM, you need to reinitialize the Boot2Docker VM
|
||
with new memory settings.</p>
|
||
|
||
<ol>
|
||
<li><p>Stop all running containers.</p></li>
|
||
|
||
<li><p>View the current memory setting.</p>
|
||
|
||
<pre><code>$ boot2docker info
|
||
{
|
||
&quot;Name&quot;: &quot;boot2docker-vm&quot;,
|
||
&quot;UUID&quot;: &quot;491736fd-4075-4be7-a6f5-1d4cdcf2cc74&quot;,
|
||
&quot;Iso&quot;: &quot;/Users/mary/.boot2docker/boot2docker.iso&quot;,
|
||
&quot;State&quot;: &quot;running&quot;,
|
||
&quot;CPUs&quot;: 8,
|
||
&quot;Memory&quot;: 2048,
|
||
&quot;VRAM&quot;: 8,
|
||
&quot;CfgFile&quot;: &quot;/Users/mary/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox&quot;,
|
||
&quot;BaseFolder&quot;: &quot;/Users/mary/VirtualBox VMs/boot2docker-vm&quot;,
|
||
&quot;OSType&quot;: &quot;&quot;,
|
||
&quot;Flag&quot;: 0,
|
||
&quot;BootOrder&quot;: null,
|
||
&quot;DockerPort&quot;: 0,
|
||
&quot;SSHPort&quot;: 2022,
|
||
&quot;SerialFile&quot;: &quot;/Users/mary/.boot2docker/boot2docker-vm.sock&quot;
|
||
}
|
||
</code></pre></li>
|
||
|
||
<li><p>Delete your existing <code>boot2docker</code> profile.</p>
|
||
|
||
<pre><code>$ boot2docker delete
|
||
</code></pre></li>
|
||
|
||
<li><p>Reinitialize <code>boot2docker</code> and specify a higher memory.</p>
|
||
|
||
<pre><code>$ boot2docker init -m 5555
|
||
</code></pre></li>
|
||
|
||
<li><p>Verify the memory was reset.</p>
|
||
|
||
<pre><code>$ boot2docker info
|
||
</code></pre></li>
|
||
|
||
<li><p>Restart your container and try your test again.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="testing-just-the-windows-client">Testing just the Windows client</h2>
|
||
|
||
<p>This explains how to test the Windows client on a Windows server set up as a
|
||
development environment. You&rsquo;ll use the <strong>Git Bash</strong> came with the Git for
|
||
Windows installation. <strong>Git Bash</strong> just as it sounds allows you to run a Bash
|
||
terminal on Windows.</p>
|
||
|
||
<ol>
|
||
<li><p>If you don&rsquo;t have one, start a Git Bash terminal.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/git_bash.png" alt="Git Bash" />
|
||
</p></li>
|
||
|
||
<li><p>Change to the <code>docker</code> source directory.</p>
|
||
|
||
<pre><code>$ cd /c/gopath/src/github.com/docker/docker
|
||
</code></pre></li>
|
||
|
||
<li><p>Set <code>DOCKER_CLIENTONLY</code> as follows:</p>
|
||
|
||
<pre><code>$ export DOCKER_CLIENTONLY=1
|
||
</code></pre>
|
||
|
||
<p>This ensures you are building only the client binary instead of both the
|
||
binary and the daemon.</p></li>
|
||
|
||
<li><p>Set <code>DOCKER_TEST_HOST</code> to the <code>tcp://IP_ADDRESS:2376</code> value; substitute your
|
||
machine&rsquo;s actual IP address, for example:</p>
|
||
|
||
<pre><code>$ export DOCKER_TEST_HOST=tcp://263.124.23.200:2376
|
||
</code></pre></li>
|
||
|
||
<li><p>Make the binary and the test:</p>
|
||
|
||
<pre><code>$ hack/make.sh binary test-integration-cli
|
||
</code></pre></li>
|
||
</ol>
|
||
|
||
<p>Many tests are skipped on Windows for various reasons. You see which tests
|
||
were skipped by re-running the make and passing in the
|
||
<code>TESTFLAGS='-test.v'</code> value.</p>
|
||
|
||
<p>You can now choose to make changes to the Docker source or the tests. If you
|
||
make any changes just run these commands again.</p>
|
||
|
||
<h2 id="build-and-test-the-documentation">Build and test the documentation</h2>
|
||
|
||
<p>The Docker documentation source files are under <code>docs</code>. The content is
|
||
written using extended Markdown. We use the static generator <a
|
||
href="http://www.mkdocs.org/" target="_blank">MkDocs</a> to build Docker&rsquo;s
|
||
documentation. Of course, you don&rsquo;t need to install this generator
|
||
to build the documentation, it is included with container.</p>
|
||
|
||
<p>You should always check your documentation for grammar and spelling. The best
|
||
way to do this is with <a href="http://www.hemingwayapp.com/"
|
||
target="_blank">an online grammar checker</a>.</p>
|
||
|
||
<p>When you change a documentation source file, you should test your change
|
||
locally to make sure your content is there and any links work correctly. You
|
||
can build the documentation from the local host. The build starts a container
|
||
and loads the documentation into a server. As long as this container runs, you
|
||
can browse the docs.</p>
|
||
|
||
<ol>
|
||
<li><p>In a terminal, change to the root of your <code>docker-fork</code> repository.</p>
|
||
|
||
<pre><code>$ cd ~/repos/docker-fork
|
||
</code></pre></li>
|
||
|
||
<li><p>Make sure you are in your feature branch.</p>
|
||
|
||
<pre><code>$ git status
|
||
On branch dry-run-test
|
||
Your branch is up-to-date with 'origin/dry-run-test'.
|
||
nothing to commit, working directory clean
|
||
</code></pre></li>
|
||
|
||
<li><p>Build the documentation.</p>
|
||
|
||
<pre><code>$ make docs
|
||
</code></pre>
|
||
|
||
<p>When the build completes, you&rsquo;ll see a final output message similar to the
|
||
following:</p>
|
||
|
||
<pre><code>Successfully built ee7fe7553123
|
||
docker run --rm -it -e AWS_S3_BUCKET -e NOCACHE -p 8000:8000 &quot;docker-docs:dry-run-test&quot; mkdocs serve
|
||
Running at: http://0.0.0.0:8000/
|
||
Live reload enabled.
|
||
Hold ctrl+c to quit.
|
||
</code></pre></li>
|
||
|
||
<li><p>Enter the URL in your browser.</p>
|
||
|
||
<p>If you are running Boot2Docker, replace the default localhost address
|
||
(0.0.0.0) with your DOCKERHOST value. You can get this value at any time by
|
||
entering <code>boot2docker ip</code> at the command line.</p></li>
|
||
|
||
<li><p>Once in the documentation, look for the red notice to verify you are seeing the correct build.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/red_notice.png" alt="Beta documentation" />
|
||
</p></li>
|
||
|
||
<li><p>Navigate to your new or changed document.</p></li>
|
||
|
||
<li><p>Review both the content and the links.</p></li>
|
||
|
||
<li><p>Return to your terminal and exit out of the running documentation container.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="where-to-go-next">Where to go next</h2>
|
||
|
||
<p>Congratulations, you have successfully completed the basics you need to
|
||
understand the Docker test framework. In the next steps, you use what you have
|
||
learned so far to <a href="http://localhost/project/project/project/make-a-contribution/">contribute to Docker by working on an
|
||
issue</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Set up for development on Windows</title>
|
||
<link>http://localhost/project/software-req-win/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/software-req-win/</guid>
|
||
<description>
|
||
|
||
<h1 id="get-the-required-software-for-windows">Get the required software for Windows</h1>
|
||
|
||
<p>This page explains how to get the software you need to use a a Windows Server
|
||
2012 or Windows 8 machine for Docker development. Before you begin contributing
|
||
you must have:</p>
|
||
|
||
<ul>
|
||
<li>a GitHub account</li>
|
||
<li>Git for Windows (msysGit)</li>
|
||
<li>TDM-GCC, a compiler suite for Windows</li>
|
||
<li>MinGW (tar and xz)</li>
|
||
<li>Go language</li>
|
||
</ul>
|
||
|
||
<blockquote>
|
||
<p><strong>Note</strong>: This installation procedure refers to the <code>C:\</code> drive. If you system&rsquo;s main drive
|
||
is <code>D:\</code> you&rsquo;ll need to substitute that in where appropriate in these
|
||
instructions.</p>
|
||
</blockquote>
|
||
|
||
<h3 id="get-a-github-account">Get a GitHub account</h3>
|
||
|
||
<p>To contribute to the Docker project, you will need a <a
|
||
href="https://github.com" target="_blank">GitHub account</a>. A free account is
|
||
fine. All the Docker project repositories are public and visible to everyone.</p>
|
||
|
||
<p>You should also have some experience using both the GitHub application and <code>git</code>
|
||
on the command line.</p>
|
||
|
||
<h2 id="install-git-for-windows">Install Git for Windows</h2>
|
||
|
||
<p>Git for Windows includes several tools including msysGit, which is a build
|
||
environment. The environment contains the tools you need for development such as
|
||
Git and a Git Bash shell.</p>
|
||
|
||
<ol>
|
||
<li><p>Browse to the <a href="https://msysgit.github.io/">Git for Windows</a> download page.</p></li>
|
||
|
||
<li><p>Click <strong>Download</strong>.</p>
|
||
|
||
<p>Windows prompts you to save the file to your machine.</p></li>
|
||
|
||
<li><p>Run the saved file.</p>
|
||
|
||
<p>The system displays the <strong>Git Setup</strong> wizard.</p></li>
|
||
|
||
<li><p>Click the <strong>Next</strong> button to move through the wizard and accept all the defaults.</p></li>
|
||
|
||
<li><p>Click <strong>Finish</strong> when you are done.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="installing-tdm-gcc">Installing TDM-GCC</h2>
|
||
|
||
<p>TDM-GCC is a compiler suite for Windows. You&rsquo;ll use this suite to compile the
|
||
Docker Go code as you develop.</p>
|
||
|
||
<ol>
|
||
<li><p>Browse to
|
||
<a href="http://tdm-gcc.tdragon.net/download">tdm-gcc download page</a>.</p></li>
|
||
|
||
<li><p>Click on the latest 64-bit version of the package.</p>
|
||
|
||
<p>Windows prompts you to save the file to your machine</p></li>
|
||
|
||
<li><p>Set up the suite by running the downloaded file.</p>
|
||
|
||
<p>The system opens the <strong>TDM-GCC Setup</strong> wizard.</p></li>
|
||
|
||
<li><p>Click <strong>Create</strong>.</p></li>
|
||
|
||
<li><p>Click the <strong>Next</strong> button to move through the wizard and accept all the defaults.</p></li>
|
||
|
||
<li><p>Click <strong>Finish</strong> when you are done.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="installing-mingw-tar-and-xz">Installing MinGW (tar and xz)</h2>
|
||
|
||
<p>MinGW is a minimalist port of the GNU Compiler Collection (GCC). In this
|
||
procedure, you first download and install the MinGW installation manager. Then,
|
||
you use the manager to install the <code>tar</code> and <code>xz</code> tools from the collection.</p>
|
||
|
||
<ol>
|
||
<li><p>Browse to MinGW
|
||
<a href="http://sourceforge.net/projects/mingw/">SourceForge</a>.</p></li>
|
||
|
||
<li><p>Click <strong>Download</strong>.</p>
|
||
|
||
<p>Windows prompts you to save the file to your machine</p></li>
|
||
|
||
<li><p>Run the downloaded file.</p></li>
|
||
</ol>
|
||
|
||
<p>The system opens the <strong>MinGW Installation Manager Setup Tool</strong></p>
|
||
|
||
<ol>
|
||
<li><p>Choose <strong>Install</strong> install the MinGW Installation Manager.</p></li>
|
||
|
||
<li><p>Press <strong>Continue</strong>.</p>
|
||
|
||
<p>The system installs and then opens the MinGW Installation Manager.</p></li>
|
||
|
||
<li><p>Press <strong>Continue</strong> after the install completes to open the manager.</p></li>
|
||
|
||
<li><p>Select <strong>All Packages &gt; MSYS Base System</strong> from the left hand menu.</p>
|
||
|
||
<p>The system displays the available packages.</p></li>
|
||
|
||
<li><p>Click on the the <strong>msys-tar bin</strong> package and choose <strong>Mark for Installation</strong>.</p></li>
|
||
|
||
<li><p>Click on the <strong>msys-xz bin</strong> package and choose <strong>Mark for Installation</strong>.</p></li>
|
||
|
||
<li><p>Select <strong>Installation &gt; Apply Changes</strong>, to install the selected packages.</p>
|
||
|
||
<p>The system displays the <strong>Schedule of Pending Actions Dialog</strong>.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/windows-mingw.png" alt="windows-mingw" />
|
||
</p></li>
|
||
|
||
<li><p>Press <strong>Apply</strong></p>
|
||
|
||
<p>MingGW installs the packages for you.</p></li>
|
||
|
||
<li><p>Close the dialog and the MinGW Installation Manager.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="set-up-your-environment-variables">Set up your environment variables</h2>
|
||
|
||
<p>You&rsquo;ll need to add the compiler to your <code>Path</code> environment variable.</p>
|
||
|
||
<ol>
|
||
<li><p>Open the <strong>Control Panel</strong>.</p></li>
|
||
|
||
<li><p>Choose <strong>System and Security &gt; System</strong>.</p></li>
|
||
|
||
<li><p>Click the <strong>Advanced system settings</strong> link in the sidebar.</p>
|
||
|
||
<p>The system opens the <strong>System Properties</strong> dialog.</p></li>
|
||
|
||
<li><p>Select the <strong>Advanced</strong> tab.</p></li>
|
||
|
||
<li><p>Click <strong>Environment Variables</strong>.</p>
|
||
|
||
<p>The system opens the <strong>Environment Variables dialog</strong> dialog.</p></li>
|
||
|
||
<li><p>Locate the <strong>System variables</strong> area and scroll to the <strong>Path</strong>
|
||
variable.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/path_variable.png" alt="windows-mingw" />
|
||
</p></li>
|
||
|
||
<li><p>Click <strong>Edit</strong> to edit the variable (you can also double-click it).</p>
|
||
|
||
<p>The system opens the <strong>Edit System Variable</strong> dialog.</p></li>
|
||
|
||
<li><p>Make sure the <code>Path</code> includes <code>C:\TDM-GCC64\bin</code></p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/include_gcc.png" alt="include gcc" />
|
||
</p>
|
||
|
||
<p>If you don&rsquo;t see <code>C:\TDM-GCC64\bin</code>, add it.</p></li>
|
||
|
||
<li><p>Press <strong>OK</strong> to close this dialog.</p></li>
|
||
|
||
<li><p>Press <strong>OK</strong> twice to close out of the remaining dialogs.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="install-go-and-cross-compile-it">Install Go and cross-compile it</h2>
|
||
|
||
<p>In this section, you install the Go language. Then, you build the source so that it can cross-compile for <code>linux/amd64</code> architectures.</p>
|
||
|
||
<ol>
|
||
<li><p>Open <a href="http://golang.org/dl/">Go Language download</a> page in your browser.</p></li>
|
||
|
||
<li><p>Locate and click the latest <code>.msi</code> installer.</p>
|
||
|
||
<p>The system prompts you to save the file.</p></li>
|
||
|
||
<li><p>Run the installer.</p>
|
||
|
||
<p>The system opens the <strong>Go Programming Language Setup</strong> dialog.</p></li>
|
||
|
||
<li><p>Select all the defaults to install.</p></li>
|
||
|
||
<li><p>Press <strong>Finish</strong> to close the installation dialog.</p></li>
|
||
|
||
<li><p>Start a command prompt.</p></li>
|
||
|
||
<li><p>Change to the Go <code>src</code> directory.</p>
|
||
|
||
<pre><code>cd c:\Go\src
|
||
</code></pre></li>
|
||
|
||
<li><p>Set the following Go variables</p>
|
||
|
||
<pre><code>c:\Go\src&gt; set GOOS=linux
|
||
c:\Go\src&gt; set GOARCH=amd64
|
||
</code></pre></li>
|
||
|
||
<li><p>Compile the source.</p>
|
||
|
||
<pre><code>c:\Go\src&gt; make.bat
|
||
</code></pre>
|
||
|
||
<p>Compiling the source also adds a number of variables to your Windows environment.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="get-the-docker-repository">Get the Docker repository</h2>
|
||
|
||
<p>In this step, you start a Git <code>bash</code> terminal and get the Docker source code from
|
||
Github.</p>
|
||
|
||
<ol>
|
||
<li><p>Locate the <strong>Git Bash</strong> program and start it.</p>
|
||
|
||
<p>Recall that <strong>Git Bash</strong> came with the Git for Windows installation. <strong>Git
|
||
Bash</strong> just as it sounds allows you to run a Bash terminal on Windows.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/git_bash.png" alt="Git Bash" />
|
||
</p></li>
|
||
|
||
<li><p>Change to the root directory.</p>
|
||
|
||
<pre><code>$ cd /c/
|
||
</code></pre></li>
|
||
|
||
<li><p>Make a <code>gopath</code> directory.</p>
|
||
|
||
<pre><code>$ mkdir gopath
|
||
</code></pre></li>
|
||
|
||
<li><p>Go get the <code>docker/docker</code> repository.</p>
|
||
|
||
<pre><code>$ go.exe get github.com/docker/docker package github.com/docker/docker
|
||
imports github.com/docker/docker
|
||
imports github.com/docker/docker: no buildable Go source files in C:\gopath\src\github.com\docker\docker
|
||
</code></pre>
|
||
|
||
<p>In the next steps, you create environment variables for you Go paths.</p></li>
|
||
|
||
<li><p>Open the <strong>Control Panel</strong> on your system.</p></li>
|
||
|
||
<li><p>Choose <strong>System and Security &gt; System</strong>.</p></li>
|
||
|
||
<li><p>Click the <strong>Advanced system settings</strong> link in the sidebar.</p>
|
||
|
||
<p>The system opens the <strong>System Properties</strong> dialog.</p></li>
|
||
|
||
<li><p>Select the <strong>Advanced</strong> tab.</p></li>
|
||
|
||
<li><p>Click <strong>Environment Variables</strong>.</p>
|
||
|
||
<p>The system opens the <strong>Environment Variables dialog</strong> dialog.</p></li>
|
||
|
||
<li><p>Locate the <strong>System variables</strong> area and scroll to the <strong>Path</strong>
|
||
variable.</p></li>
|
||
|
||
<li><p>Click <strong>New</strong>.</p>
|
||
|
||
<p>Now you are going to create some new variables. These paths you&rsquo;ll create in the next procedure; but you can set them now.</p></li>
|
||
|
||
<li><p>Enter <code>GOPATH</code> for the <strong>Variable Name</strong>.</p></li>
|
||
|
||
<li><p>For the <strong>Variable Value</strong> enter the following:</p>
|
||
|
||
<pre><code>C:\gopath;C:\gopath\src\github.com\docker\docker\vendor
|
||
</code></pre></li>
|
||
|
||
<li><p>Press <strong>OK</strong> to close this dialog.</p>
|
||
|
||
<p>The system adds <code>GOPATH</code> to the list of <strong>System Variables</strong>.</p></li>
|
||
|
||
<li><p>Press <strong>OK</strong> twice to close out of the remaining dialogs.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="where-to-go-next">Where to go next</h2>
|
||
|
||
<p>In the next section, you&rsquo;ll <a href="http://localhost/project/project/project/set-up-git/">learn how to set up and configure Git for
|
||
contributing to Docker</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Style guide for Docker documentation</title>
|
||
<link>http://localhost/project/doc-style/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/doc-style/</guid>
|
||
<description>
|
||
|
||
<h1 id="docker-documentation-style-grammar-conventions">Docker documentation: style &amp; grammar conventions</h1>
|
||
|
||
<h2 id="style-standards">Style standards</h2>
|
||
|
||
<p>Over time, different publishing communities have written standards for the style
|
||
and grammar they prefer in their publications. These standards are called
|
||
<a href="http://en.wikipedia.org/wiki/Style_guide">style guides</a>. Generally, Docker’s
|
||
documentation uses the standards described in the
|
||
<a href="http://en.wikipedia.org/wiki/AP_Stylebook">Associated Press&rsquo;s (AP) style guide</a>.
|
||
If a question about syntactical, grammatical, or lexical practice comes up,
|
||
refer to the AP guide first. If you don’t have a copy of (or online subscription
|
||
to) the AP guide, you can almost always find an answer to a specific question by
|
||
searching the web. If you can’t find an answer, please ask a
|
||
<a href="https://github.com/docker/docker/blob/master/docs/MAINTAINERS">maintainer</a> and
|
||
we will find the answer.</p>
|
||
|
||
<p>That said, please don&rsquo;t get too hung up on using correct style. We&rsquo;d rather have
|
||
you submit good information that doesn&rsquo;t conform to the guide than no
|
||
information at all. Docker&rsquo;s tech writers are always happy to help you with the
|
||
prose, and we promise not to judge or use a red pen!</p>
|
||
|
||
<blockquote>
|
||
<p><strong>Note:</strong>
|
||
The documentation is written with paragraphs wrapped at 80 column lines to
|
||
make it easier for terminal use. You can probably set up your favorite text
|
||
editor to do this automatically for you.</p>
|
||
</blockquote>
|
||
|
||
<h3 id="prose-style">Prose style</h3>
|
||
|
||
<p>In general, try to write simple, declarative prose. We prefer short,
|
||
single-clause sentences and brief three-to-five sentence paragraphs. Try to
|
||
choose vocabulary that is straightforward and precise. Avoid creating new terms,
|
||
using obscure terms or, in particular, using a lot of jargon. For example, use
|
||
&ldquo;use&rdquo; instead of leveraging &ldquo;leverage&rdquo;.</p>
|
||
|
||
<p>That said, don’t feel like you have to write for localization or for
|
||
English-as-a-second-language (ESL) speakers specifically. Assume you are writing
|
||
for an ordinary speaker of English with a basic university education. If your
|
||
prose is simple, clear, and straightforward it will translate readily.</p>
|
||
|
||
<p>One way to think about this is to assume Docker’s users are generally university
|
||
educated and read at at least a &ldquo;16th&rdquo; grade level (meaning they have a
|
||
university degree). You can use a <a href="https://readability-score.com/">readability
|
||
tester</a> to help guide your judgement. For
|
||
example, the readability score for the phrase &ldquo;Containers should be ephemeral&rdquo;
|
||
is around the 13th grade level (first year at university), and so is acceptable.</p>
|
||
|
||
<p>In all cases, we prefer clear, concise communication over stilted, formal
|
||
language. Don&rsquo;t feel like you have to write documentation that &ldquo;sounds like
|
||
technical writing.&rdquo;</p>
|
||
|
||
<h3 id="metaphor-and-figurative-language">Metaphor and figurative language</h3>
|
||
|
||
<p>One exception to the &ldquo;don’t write directly for ESL&rdquo; rule is to avoid the use of
|
||
metaphor or other
|
||
<a href="http://en.wikipedia.org/wiki/Literal_and_figurative_language">figurative language</a> to
|
||
describe things. There are too many cultural and social issues that can prevent
|
||
a reader from correctly interpreting a metaphor.</p>
|
||
|
||
<h2 id="specific-conventions">Specific conventions</h2>
|
||
|
||
<p>Below are some specific recommendations (and a few deviations) from AP style
|
||
that we use in our docs.</p>
|
||
|
||
<h3 id="contractions">Contractions</h3>
|
||
|
||
<p>As long as your prose does not become too slangy or informal, it&rsquo;s perfectly
|
||
acceptable to use contractions in our documentation. Make sure to use
|
||
apostrophes correctly.</p>
|
||
|
||
<h3 id="use-of-dashes-in-a-sentence">Use of dashes in a sentence.</h3>
|
||
|
||
<p>Dashes refers to the en dash (–) and the em dash (—). Dashes can be used to
|
||
separate parenthetical material.</p>
|
||
|
||
<p>Usage Example: This is an example of a Docker client – which uses the Big Widget
|
||
to run – and does x, y, and z.</p>
|
||
|
||
<p>Use dashes cautiously and consider whether commas or parentheses would work just
|
||
as well. We always emphasize short, succinct sentences.</p>
|
||
|
||
<p>More info from the always handy <a href="http://www.quickanddirtytips.com/education/grammar/dashes-parentheses-and-commas">Grammar Girl site</a>.</p>
|
||
|
||
<h3 id="pronouns">Pronouns</h3>
|
||
|
||
<p>It&rsquo;s okay to use first and second person pronouns. Specifically, use &ldquo;we&rdquo; to
|
||
refer to Docker and &ldquo;you&rdquo; to refer to the user. For example, &ldquo;We built the
|
||
<code>exec</code> command so you can resize a TTY session.&rdquo;</p>
|
||
|
||
<p>As much as possible, avoid using gendered pronouns (&ldquo;he&rdquo; and &ldquo;she&rdquo;, etc.).
|
||
Either recast the sentence so the pronoun is not needed or, less preferably,
|
||
use &ldquo;they&rdquo; instead. If you absolutely can&rsquo;t get around using a gendered pronoun,
|
||
pick one and stick to it. Which one you choose is up to you. One common
|
||
convention is to use the pronoun of the author&rsquo;s gender, but if you prefer to
|
||
default to &ldquo;he&rdquo; or &ldquo;she&rdquo;, that&rsquo;s fine too.</p>
|
||
|
||
<h3 id="capitalization">Capitalization</h3>
|
||
|
||
<h4 id="in-general">In general</h4>
|
||
|
||
<p>Only proper nouns should be capitalized in body text. In general, strive to be
|
||
as strict as possible in applying this rule. Avoid using capitals for emphasis
|
||
or to denote &ldquo;specialness&rdquo;.</p>
|
||
|
||
<p>The word &ldquo;Docker&rdquo; should always be capitalized when referring to either the
|
||
company or the technology. The only exception is when the term appears in a code
|
||
sample.</p>
|
||
|
||
<h4 id="starting-sentences">Starting sentences</h4>
|
||
|
||
<p>Because code samples should always be written exactly as they would appear
|
||
on-screen, you should avoid starting sentences with a code sample.</p>
|
||
|
||
<h4 id="in-headings">In headings</h4>
|
||
|
||
<p>Headings take sentence capitalization, meaning that only the first letter is
|
||
capitalized (and words that would normally be capitalized in a sentence, e.g.,
|
||
&ldquo;Docker&rdquo;). Do not use Title Case (i.e., capitalizing every word) for headings. Generally, we adhere to <a href="http://www.quickanddirtytips.com/education/grammar/capitalizing-titles">AP style
|
||
for titles</a>.</p>
|
||
|
||
<h2 id="periods">Periods</h2>
|
||
|
||
<p>We prefer one space after a period at the end of a sentence, not two.</p>
|
||
|
||
<p>See <a href="#lists">lists</a> below for how to punctuate list items.</p>
|
||
|
||
<h3 id="abbreviations-and-acronyms">Abbreviations and acronyms</h3>
|
||
|
||
<ul>
|
||
<li><p>Exempli gratia (e.g.) and id est ( i.e.): these should always have periods and
|
||
are always followed by a comma.</p></li>
|
||
|
||
<li><p>Acronyms are pluralized by simply adding &ldquo;s&rdquo;, e.g., PCs, OSs.</p></li>
|
||
|
||
<li><p>On first use on a given page, the complete term should be used, with the
|
||
abbreviation or acronym in parentheses. E.g., Red Hat Enterprise Linux (RHEL).
|
||
The exception is common, non-technical acronyms like AKA or ASAP. Note that
|
||
acronyms other than i.e. and e.g. are capitalized.</p></li>
|
||
|
||
<li><p>Other than &ldquo;e.g.&rdquo; and &ldquo;i.e.&rdquo; (as discussed above), acronyms do not take
|
||
periods, PC not P.C.</p></li>
|
||
</ul>
|
||
|
||
<h3 id="lists">Lists</h3>
|
||
|
||
<p>When writing lists, keep the following in mind:</p>
|
||
|
||
<p>Use bullets when the items being listed are independent of each other and the
|
||
order of presentation is not important.</p>
|
||
|
||
<p>Use numbers for steps that have to happen in order or if you have mentioned the
|
||
list in introductory text. For example, if you wrote &ldquo;There are three config
|
||
settings available for SSL, as follows:&ldquo;, you would number each config setting
|
||
in the subsequent list.</p>
|
||
|
||
<p>In all lists, if an item is a complete sentence, it should end with a
|
||
period. Otherwise, we prefer no terminal punctuation for list items.
|
||
Each item in a list should start with a capital.</p>
|
||
|
||
<h3 id="numbers">Numbers</h3>
|
||
|
||
<p>Write out numbers in body text and titles from one to ten. From 11 on, use numerals.</p>
|
||
|
||
<h3 id="notes">Notes</h3>
|
||
|
||
<p>Use notes sparingly and only to bring things to the reader&rsquo;s attention that are
|
||
critical or otherwise deserving of being called out from the body text. Please
|
||
format all notes as follows:</p>
|
||
|
||
<pre><code>&gt; **Note:**
|
||
&gt; One line of note text
|
||
&gt; another line of note text
|
||
</code></pre>
|
||
|
||
<h3 id="avoid-excess-use-of-i-e">Avoid excess use of &ldquo;i.e.&rdquo;</h3>
|
||
|
||
<p>Minimize your use of &ldquo;i.e.&rdquo;. It can add an unnecessary interpretive burden on
|
||
the reader. Avoid writing &ldquo;This is a thing, i.e., it is like this&rdquo;. Just
|
||
say what it is: &ldquo;This thing is …&rdquo;</p>
|
||
|
||
<h3 id="preferred-usages">Preferred usages</h3>
|
||
|
||
<h4 id="login-vs-log-in">Login vs. log in.</h4>
|
||
|
||
<p>A &ldquo;login&rdquo; is a noun (one word), as in &ldquo;Enter your login&rdquo;. &ldquo;Log in&rdquo; is a compound
|
||
verb (two words), as in &ldquo;Log in to the terminal&rdquo;.</p>
|
||
|
||
<h3 id="oxford-comma">Oxford comma</h3>
|
||
|
||
<p>One way in which we differ from AP style is that Docker’s docs use the <a href="http://en.wikipedia.org/wiki/Serial_comma">Oxford
|
||
comma</a> in all cases. That’s our
|
||
position on this controversial topic, we won&rsquo;t change our mind, and that’s that!</p>
|
||
|
||
<h3 id="code-and-ui-text-styling">Code and UI text styling</h3>
|
||
|
||
<p>We require <code>code font</code> styling (monospace, sans-serif) for all text that refers
|
||
to a command or other input or output from the CLI. This includes file paths
|
||
(e.g., <code>/etc/hosts/docker.conf</code>). If you enclose text in backticks (`) markdown
|
||
will style the text as code.</p>
|
||
|
||
<p>Text from a CLI should be quoted verbatim, even if it contains errors or its
|
||
style contradicts this guide. You can add &ldquo;(sic)&rdquo; after the quote to indicate
|
||
the errors are in the quote and are not errors in our docs.</p>
|
||
|
||
<p>Text taken from a GUI (e.g., menu text or button text) should appear in &ldquo;double
|
||
quotes&rdquo;. The text should take the exact same capitalisation, etc. as appears in
|
||
the GUI. E.g., Click &ldquo;Continue&rdquo; to save the settings.</p>
|
||
|
||
<p>Text that refers to a keyboard command or hotkey is capitalized (e.g., Ctrl-D).</p>
|
||
|
||
<p>When writing CLI examples, give the user hints by making the examples resemble
|
||
exactly what they see in their shell:</p>
|
||
|
||
<ul>
|
||
<li>Indent shell examples by 4 spaces so they get rendered as code blocks.</li>
|
||
<li>Start typed commands with <code>$</code> (dollar space), so that they are easily
|
||
differentiated from program output.</li>
|
||
<li>Program output has no prefix.</li>
|
||
<li>Comments begin with # (hash space).</li>
|
||
<li>In-container shell commands, begin with <code>$$</code> (dollar dollar space).</li>
|
||
</ul>
|
||
|
||
<p>Please test all code samples to ensure that they are correct and functional so
|
||
that users can successfully cut-and-paste samples directly into the CLI.</p>
|
||
|
||
<h2 id="pull-requests">Pull requests</h2>
|
||
|
||
<p>The pull request (PR) process is in place so that we can ensure changes made to
|
||
the docs are the best changes possible. A good PR will do some or all of the
|
||
following:</p>
|
||
|
||
<ul>
|
||
<li>Explain why the change is needed</li>
|
||
<li>Point out potential issues or questions</li>
|
||
<li>Ask for help from experts in the company or the community</li>
|
||
<li>Encourage feedback from core developers and others involved in creating the
|
||
software being documented.</li>
|
||
</ul>
|
||
|
||
<p>Writing a PR that is singular in focus and has clear objectives will encourage
|
||
all of the above. Done correctly, the process allows reviewers (maintainers and
|
||
community members) to validate the claims of the documentation and identify
|
||
potential problems in communication or presentation.</p>
|
||
|
||
<h3 id="commit-messages">Commit messages</h3>
|
||
|
||
<p>In order to write clear, useful commit messages, please follow these
|
||
<a href="http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message">recommendations</a>.</p>
|
||
|
||
<h2 id="links">Links</h2>
|
||
|
||
<p>For accessibility and usability reasons, avoid using phrases such as &ldquo;click
|
||
here&rdquo; for link text. Recast your sentence so that the link text describes the
|
||
content of the link, as we did in the
|
||
<a href="#commit-messages">&ldquo;Commit messages&rdquo; section</a> above.</p>
|
||
|
||
<p>You can use relative links (../linkeditem) to link to other pages in Docker&rsquo;s
|
||
documentation.</p>
|
||
|
||
<h2 id="graphics">Graphics</h2>
|
||
|
||
<p>When you need to add a graphic, try to make the file-size as small as possible.
|
||
If you need help reducing file-size of a high-resolution image, feel free to
|
||
contact us for help.
|
||
Usually, graphics should go in the same directory as the .md file that
|
||
references them, or in a subdirectory for images if one already exists.</p>
|
||
|
||
<p>The preferred file format for graphics is PNG, but GIF and JPG are also
|
||
acceptable.</p>
|
||
|
||
<p>If you are referring to a specific part of the UI in an image, use
|
||
call-outs (circles and arrows or lines) to highlight what you’re referring to.
|
||
Line width for call-outs should not exceed five pixels. The preferred color for
|
||
call-outs is red.</p>
|
||
|
||
<p>Be sure to include descriptive alt-text for the graphic. This greatly helps
|
||
users with accessibility issues.</p>
|
||
|
||
<p>Lastly, be sure you have permission to use any included graphics.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Understand how to contribute</title>
|
||
<link>http://localhost/project/make-a-contribution/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/make-a-contribution/</guid>
|
||
<description>
|
||
|
||
<h1 id="understand-how-to-contribute">Understand how to contribute</h1>
|
||
|
||
<p>Contributing is a process where you work with Docker maintainers and the
|
||
community to improve Docker. The maintainers are experienced contributors
|
||
who specialize in one or more Docker components. Maintainers play a big role
|
||
in reviewing contributions.</p>
|
||
|
||
<p>There is a formal process for contributing. We try to keep our contribution
|
||
process simple so you&rsquo;ll want to contribute frequently.</p>
|
||
|
||
<h2 id="the-basic-contribution-workflow">The basic contribution workflow</h2>
|
||
|
||
<p>In this guide, you work through Docker&rsquo;s basic contribution workflow by fixing a
|
||
single <em>beginner</em> issue in the <code>docker/docker</code> repository. The workflow
|
||
for fixing simple issues looks like this:</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/existing_issue.png" alt="Simple process" />
|
||
</p>
|
||
|
||
<p>All Docker repositories have code and documentation. You use this same workflow
|
||
for either content type. For example, you can find and fix doc or code issues.
|
||
Also, you can propose a new Docker feature or propose a new Docker tutorial.</p>
|
||
|
||
<p>Some workflow stages do have slight differences for code or documentation
|
||
contributions. When you reach that point in the flow, we make sure to tell you.</p>
|
||
|
||
<h2 id="where-to-go-next">Where to go next</h2>
|
||
|
||
<p>Now that you know a little about the contribution process, go to the next section
|
||
to <a href="http://localhost/project/project/project/find-an-issue/">find an issue you want to work on</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Where to chat or get help</title>
|
||
<link>http://localhost/project/get-help/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/get-help/</guid>
|
||
<description>
|
||
|
||
<p><style type="text/css">
|
||
/* @TODO add &lsquo;no-zebra&rsquo; table-style to the docs-base stylesheet <em>/
|
||
/</em> Table without &ldquo;zebra&rdquo; striping */
|
||
.content-body table.no-zebra tr {
|
||
background-color: transparent;
|
||
}
|
||
</style></p>
|
||
|
||
<h1 id="where-to-chat-or-get-help">Where to chat or get help</h1>
|
||
|
||
<p>There are several communications channels you can use to chat with Docker
|
||
community members and developers.</p>
|
||
|
||
<table>
|
||
<col width="25%">
|
||
<col width="75%">
|
||
<tr>
|
||
<td>Internet Relay Chat (IRC)</th>
|
||
<td>
|
||
<p>
|
||
IRC a direct line to our most knowledgeable Docker users.
|
||
The <code>#docker</code> and <code>#docker-dev</code> group on
|
||
<strong>irc.freenode.net</strong>. IRC was first created in 1988.
|
||
So, it is a rich chat protocol but it can overwhelm new users. You can search
|
||
<a href="https://botbot.me/freenode/docker/#" target="_blank">our chat archives</a>.
|
||
</p>
|
||
Read our IRC quickstart guide below for an easy way to get started.
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Google Groups</td>
|
||
<td>
|
||
There are two groups.
|
||
<a href="https://groups.google.com/forum/#!forum/docker-user" target="_blank">Docker-user</a>
|
||
is for people using Docker containers.
|
||
The <a href="https://groups.google.com/forum/#!forum/docker-dev" target="_blank">docker-dev</a>
|
||
group is for contributors and other people contributing to the Docker
|
||
project.
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Twitter</td>
|
||
<td>
|
||
You can follow <a href="https://twitter.com/docker/" target="_blank">Docker's twitter</a>
|
||
to get updates on our products. You can also tweet us questions or just
|
||
share blogs or stories.
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Stack Overflow</td>
|
||
<td>
|
||
Stack Overflow has over 7000K Docker questions listed. We regularly
|
||
monitor <a href="http://stackoverflow.com/search?tab=newest&q=docker" target="_blank">Docker questions</a>
|
||
and so do many other knowledgeable Docker users.
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<h2 id="irc-quickstart">IRC Quickstart</h2>
|
||
|
||
<p>IRC can also be overwhelming for new users. This quickstart shows you
|
||
the easiest way to connect to IRC.</p>
|
||
|
||
<ol>
|
||
<li><p>In your browser open <a href="http://webchat.freenode.net" target="_blank"><a href="http://webchat.freenode.net">http://webchat.freenode.net</a></a></p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/irc_connect.png" alt="Login screen" />
|
||
</p></li>
|
||
|
||
<li><p>Fill out the form.</p>
|
||
|
||
<table class="no-zebra" style="width: auto">
|
||
<tr>
|
||
<td><b>Nickname</b></td>
|
||
<td>The short name you want to be known as in IRC.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><b>Channels</b></td>
|
||
<td><code>#docker</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td><b>reCAPTCHA</b></td>
|
||
<td>Use the value provided.</td>
|
||
</tr>
|
||
</table></li>
|
||
|
||
<li><p>Click &ldquo;Connect&rdquo;.</p>
|
||
|
||
<p>The system connects you to chat. You&rsquo;ll see a lot of text. At the bottom of
|
||
the display is a command line. Just above the command line the system asks
|
||
you to register.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/irc_after_login.png" alt="Login screen" />
|
||
</p></li>
|
||
|
||
<li><p>In the command line, register your nickname.</p>
|
||
|
||
<pre><code>/msg NickServ REGISTER password youremail@example.com
|
||
</code></pre>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/register_nic.png" alt="Login screen" />
|
||
</p>
|
||
|
||
<p>The IRC system sends an email to the address you
|
||
enter. The email contains instructions for completing your registration.</p></li>
|
||
|
||
<li><p>Open your mail client and look for the email.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/register_email.png" alt="Login screen" />
|
||
</p></li>
|
||
|
||
<li><p>Back in the browser, complete the registration according to the email.</p>
|
||
|
||
<pre><code>/msg NickServ VERIFY REGISTER moxiegirl_ acljtppywjnr
|
||
</code></pre></li>
|
||
|
||
<li><p>Join the <code>#docker</code> group using the following command.</p>
|
||
|
||
<pre><code>/j #docker
|
||
</code></pre>
|
||
|
||
<p>You can also join the <code>#docker-dev</code> group.</p>
|
||
|
||
<pre><code>/j #docker-dev
|
||
</code></pre></li>
|
||
|
||
<li><p>To ask questions to the channel just type messages in the command line.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/irc_chat.png" alt="Login screen" />
|
||
</p></li>
|
||
|
||
<li><p>To quit, close the browser window.</p></li>
|
||
</ol>
|
||
|
||
<h3 id="tips-and-learning-more-about-irc">Tips and learning more about IRC</h3>
|
||
|
||
<p>Next time you return to log into chat, you&rsquo;ll need to re-enter your password
|
||
on the command line using this command:</p>
|
||
|
||
<pre><code>/msg NickServ identify &lt;password&gt;
|
||
</code></pre>
|
||
|
||
<p>If you forget or lose your password see <a
|
||
href="https://freenode.net/faq.shtml#sendpass" target="_blank">the FAQ on
|
||
freenode.net</a> to learn how to recover it.</p>
|
||
|
||
<p>This quickstart was meant to get you up and into IRC very quickly. If you find
|
||
IRC useful there is a lot more to learn. Drupal, another open source project,
|
||
actually has <a href="https://www.drupal.org/irc/setting-up" target="_blank">
|
||
written a lot of good documentation about using IRC</a> for their project
|
||
(thanks Drupal!).</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Work on your issue</title>
|
||
<link>http://localhost/project/work-issue/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/work-issue/</guid>
|
||
<description>
|
||
|
||
<h1 id="work-on-your-issue">Work on your issue</h1>
|
||
|
||
<p>The work you do for your issue depends on the specific issue you picked.
|
||
This section gives you a step-by-step workflow. Where appropriate, it provides
|
||
command examples.</p>
|
||
|
||
<p>However, this is a generalized workflow, depending on your issue you may repeat
|
||
steps or even skip some. How much time the work takes depends on you &mdash; you
|
||
could spend days or 30 minutes of your time.</p>
|
||
|
||
<h2 id="how-to-work-on-your-local-branch">How to work on your local branch</h2>
|
||
|
||
<p>Follow this workflow as you work:</p>
|
||
|
||
<ol>
|
||
<li><p>Review the appropriate style guide.</p>
|
||
|
||
<p>If you are changing code, review the <a href="../coding-style"
|
||
target="_blank">coding style guide</a>. Changing documentation? Review the
|
||
<a href="../doc-style" target="_blank">documentation style guide</a>.</p></li>
|
||
|
||
<li><p>Make changes in your feature branch.</p>
|
||
|
||
<p>Your feature branch you created in the last section. Here you use the
|
||
development container. If you are making a code change, you can mount your
|
||
source into a development container and iterate that way. For documentation
|
||
alone, you can work on your local host.</p>
|
||
|
||
<p>Make sure you don&rsquo;t change files in the <code>vendor</code> directory and its
|
||
subdirectories; they contain third-party dependency code. Review <a
|
||
href="../set-up-dev-env" target="_blank">if you forgot the details of
|
||
working with a container</a>.</p></li>
|
||
|
||
<li><p>Test your changes as you work.</p>
|
||
|
||
<p>If you have followed along with the guide, you know the <code>make test</code> target
|
||
runs the entire test suite and <code>make docs</code> builds the documentation. If you
|
||
forgot the other test targets, see the documentation for <a
|
||
href="../test-and-docs" target="_blank">testing both code and
|
||
documentation</a>.</p></li>
|
||
|
||
<li><p>For code changes, add unit tests if appropriate.</p>
|
||
|
||
<p>If you add new functionality or change existing functionality, you should
|
||
add a unit test also. Use the existing test files for inspiration. Aren&rsquo;t
|
||
sure if you need tests? Skip this step; you can add them later in the
|
||
process if necessary.</p></li>
|
||
|
||
<li><p>Format your source files correctly.</p>
|
||
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>File type</th>
|
||
<th>How to format</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><code>.go</code></td>
|
||
<td>
|
||
<p>
|
||
Format <code>.go</code> files using the <code>gofmt</code> command.
|
||
For example, if you edited the `docker.go` file you would format the file
|
||
like this:
|
||
</p>
|
||
<p><code>$ gofmt -s -w docker.go</code></p>
|
||
<p>
|
||
Most file editors have a plugin to format for you. Check your editor's
|
||
documentation.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="white-space: nowrap"><code>.md</code> and non-<code>.go</code> files</td>
|
||
<td>Wrap lines to 80 characters.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></li>
|
||
|
||
<li><p>List your changes.</p>
|
||
|
||
<pre><code>$ git status
|
||
On branch 11038-fix-rhel-link
|
||
Changes not staged for commit:
|
||
(use &quot;git add &lt;file&gt;...&quot; to update what will be committed)
|
||
(use &quot;git checkout -- &lt;file&gt;...&quot; to discard changes in working directory)
|
||
|
||
|
||
modified: docs/installation/mac.md
|
||
modified: docs/installation/rhel.md
|
||
</code></pre>
|
||
|
||
<p>The <code>status</code> command lists what changed in the repository. Make sure you see
|
||
the changes you expect.</p></li>
|
||
|
||
<li><p>Add your change to Git.</p>
|
||
|
||
<pre><code>$ git add docs/installation/mac.md
|
||
$ git add docs/installation/rhel.md
|
||
</code></pre></li>
|
||
|
||
<li><p>Commit your changes making sure you use the <code>-s</code> flag to sign your work.</p>
|
||
|
||
<pre><code>$ git commit -s -m &quot;Fixing RHEL link&quot;
|
||
</code></pre></li>
|
||
|
||
<li><p>Push your change to your repository.</p>
|
||
|
||
<pre><code>$ git push origin 11038-fix-rhel-link
|
||
Username for 'https://github.com': moxiegirl
|
||
Password for 'https://moxiegirl@github.com':
|
||
Counting objects: 60, done.
|
||
Compressing objects: 100% (7/7), done.
|
||
Writing objects: 100% (7/7), 582 bytes | 0 bytes/s, done.
|
||
Total 7 (delta 6), reused 0 (delta 0)
|
||
To https://github.com/moxiegirl/docker.git
|
||
* [new branch] 11038-fix-rhel-link -&gt; 11038-fix-rhel-link
|
||
Branch 11038-fix-rhel-link set up to track remote branch 11038-fix-rhel-link from origin.
|
||
</code></pre></li>
|
||
</ol>
|
||
|
||
<h2 id="review-your-branch-on-github">Review your branch on GitHub</h2>
|
||
|
||
<p>After you push a new branch, you should verify it on GitHub:</p>
|
||
|
||
<ol>
|
||
<li><p>Open your browser to <a href="https://github.com" target="_blank">GitHub</a>.</p></li>
|
||
|
||
<li><p>Go to your Docker fork.</p></li>
|
||
|
||
<li><p>Select your branch from the dropdown.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/locate_branch.png" alt="Find branch" />
|
||
</p></li>
|
||
|
||
<li><p>Use the &ldquo;Compare&rdquo; button to compare the differences between your branch and master.</p>
|
||
|
||
<p>Depending how long you&rsquo;ve been working on your branch, your branch maybe
|
||
behind Docker&rsquo;s upstream repository.</p></li>
|
||
|
||
<li><p>Review the commits.</p>
|
||
|
||
<p>Make sure your branch only shows the work you&rsquo;ve done.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="pull-and-rebase-frequently">Pull and rebase frequently</h2>
|
||
|
||
<p>You should pull and rebase frequently as you work.</p>
|
||
|
||
<ol>
|
||
<li><p>Return to the terminal on your local machine and checkout your
|
||
feature branch in your local <code>docker-fork</code> repository.</p></li>
|
||
|
||
<li><p>Fetch any last minute changes from <code>docker/docker</code>.</p>
|
||
|
||
<pre><code>$ git fetch upstream master
|
||
From github.com:docker/docker
|
||
* branch master -&gt; FETCH_HEAD
|
||
</code></pre></li>
|
||
|
||
<li><p>Start an interactive rebase.</p>
|
||
|
||
<pre><code>$ git rebase -i upstream/master
|
||
</code></pre></li>
|
||
|
||
<li><p>Rebase opens an editor with a list of commits.</p>
|
||
|
||
<pre><code>pick 1a79f55 Tweak some of the other text for grammar
|
||
pick 53e4983 Fix a link
|
||
pick 3ce07bb Add a new line about RHEL
|
||
</code></pre></li>
|
||
|
||
<li><p>Replace the <code>pick</code> keyword with <code>squash</code> on all but the first commit.</p>
|
||
|
||
<pre><code>pick 1a79f55 Tweak some of the other text for grammar
|
||
squash 53e4983 Fix a link
|
||
squash 3ce07bb Add a new line about RHEL
|
||
</code></pre>
|
||
|
||
<p>After you save the changes and quit from the editor, git starts
|
||
the rebase, reporting the progress along the way. Sometimes
|
||
your changes can conflict with the work of others. If git
|
||
encounters a conflict, it stops the rebase, and prints guidance
|
||
for how to correct the conflict.</p></li>
|
||
|
||
<li><p>Edit and save your commit message.</p>
|
||
|
||
<pre><code>$ git commit -s
|
||
</code></pre>
|
||
|
||
<p>Make sure your message includes <a href="../set-up-git" target="_blank">your signature</a>.</p></li>
|
||
|
||
<li><p>Force push any changes to your fork on GitHub.</p>
|
||
|
||
<pre><code>$ git push -f origin 11038-fix-rhel-link
|
||
</code></pre></li>
|
||
</ol>
|
||
|
||
<h2 id="where-to-go-next">Where to go next</h2>
|
||
|
||
<p>At this point, you should understand how to work on an issue. In the next
|
||
section, you <a href="http://localhost/project/project/project/create-pr/">learn how to make a pull request</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
<item>
|
||
<title>Work with a development container</title>
|
||
<link>http://localhost/project/set-up-dev-env/</link>
|
||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||
|
||
<guid>http://localhost/project/set-up-dev-env/</guid>
|
||
<description>
|
||
|
||
<h1 id="work-with-a-development-container">Work with a development container</h1>
|
||
|
||
<p>In this section, you learn to develop like a member of Docker&rsquo;s core team.
|
||
The <code>docker</code> repository includes a <code>Dockerfile</code> at its root. This file defines
|
||
Docker&rsquo;s development environment. The <code>Dockerfile</code> lists the environment&rsquo;s
|
||
dependencies: system libraries and binaries, Go environment, Go dependencies,
|
||
etc.</p>
|
||
|
||
<p>Docker&rsquo;s development environment is itself, ultimately a Docker container.
|
||
You use the <code>docker</code> repository and its <code>Dockerfile</code> to create a Docker image,
|
||
run a Docker container, and develop code in the container. Docker itself builds,
|
||
tests, and releases new Docker versions using this container.</p>
|
||
|
||
<p>If you followed the procedures that <a href="http://localhost/project/set-up-git" target="_blank">
|
||
set up Git for contributing</a>, you should have a fork of the <code>docker/docker</code>
|
||
repository. You also created a branch called <code>dry-run-test</code>. In this section,
|
||
you continue working with your fork on this branch.</p>
|
||
|
||
<h2 id="clean-your-host-of-docker-artifacts">Clean your host of Docker artifacts</h2>
|
||
|
||
<p>Docker developers run the latest stable release of the Docker software (with Boot2Docker if their machine is Mac OS X). They clean their local
|
||
hosts of unnecessary Docker artifacts such as stopped containers or unused
|
||
images. Cleaning unnecessary artifacts isn&rsquo;t strictly necessary, but it is
|
||
good practice, so it is included here.</p>
|
||
|
||
<p>To remove unnecessary artifacts,</p>
|
||
|
||
<ol>
|
||
<li><p>Verify that you have no unnecessary containers running on your host.</p>
|
||
|
||
<pre><code>$ docker ps
|
||
</code></pre>
|
||
|
||
<p>You should see something similar to the following:</p>
|
||
|
||
<table class="code">
|
||
<tr>
|
||
<th>CONTAINER ID</th>
|
||
<th>IMAGE</th>
|
||
<th>COMMAND</th>
|
||
<th>CREATED</th>
|
||
<th>STATUS</th>
|
||
<th>PORTS</th>
|
||
<th>NAMES</th>
|
||
</tr>
|
||
</table>
|
||
|
||
<p>There are no running containers on this host. If you have running but unused
|
||
containers, stop and then remove them with the <code>docker stop</code> and <code>docker rm</code>
|
||
commands.</p></li>
|
||
|
||
<li><p>Verify that your host has no dangling images.</p>
|
||
|
||
<pre><code>$ docker images
|
||
</code></pre>
|
||
|
||
<p>You should see something similar to the following:</p>
|
||
|
||
<table class="code">
|
||
<tr>
|
||
<th>REPOSITORY</th>
|
||
<th>TAG</th>
|
||
<th>IMAGE ID</th>
|
||
<th>CREATED</th>
|
||
<th>VIRTUAL SIZE</th>
|
||
</tr>
|
||
</table>
|
||
|
||
<p>This host has no images. You may have one or more <em>dangling</em> images. A
|
||
dangling image is not used by a running container and is not an ancestor of
|
||
another image on your system. A fast way to remove dangling containers is
|
||
the following:</p>
|
||
|
||
<pre><code>$ docker rmi -f $(docker images -q -a -f dangling=true)
|
||
</code></pre>
|
||
|
||
<p>This command uses <code>docker images</code> to list all images (<code>-a</code> flag) by numeric
|
||
IDs (<code>-q</code> flag) and filter them to find dangling images (<code>-f dangling=true</code>).
|
||
Then, the <code>docker rmi</code> command forcibly (<code>-f</code> flag) removes
|
||
the resulting list. To remove just one image, use the <code>docker rmi ID</code>
|
||
command.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="build-an-image">Build an image</h2>
|
||
|
||
<p>If you followed the last procedure, your host is clean of unnecessary images
|
||
and containers. In this section, you build an image from the Docker development
|
||
environment.</p>
|
||
|
||
<ol>
|
||
<li><p>Open a terminal.</p>
|
||
|
||
<p>Mac users, use <code>boot2docker status</code> to make sure Boot2Docker is running. You
|
||
may need to run <code>eval &quot;$(boot2docker shellinit)&quot;</code> to initialize your shell
|
||
environment.</p></li>
|
||
|
||
<li><p>Change into the root of your forked repository.</p>
|
||
|
||
<pre><code>$ cd ~/repos/docker-fork
|
||
</code></pre>
|
||
|
||
<p>If you are following along with this guide, you created a <code>dry-run-test</code>
|
||
branch when you <a href="http://localhost/project/set-up-git" target="_blank"> set up Git for
|
||
contributing</a>.</p></li>
|
||
|
||
<li><p>Ensure you are on your <code>dry-run-test</code> branch.</p>
|
||
|
||
<pre><code>$ git checkout dry-run-test
|
||
</code></pre>
|
||
|
||
<p>If you get a message that the branch doesn&rsquo;t exist, add the <code>-b</code> flag (git checkout -b dry-run-test) so the
|
||
command both creates the branch and checks it out.</p></li>
|
||
|
||
<li><p>Compile your development environment container into an image.</p>
|
||
|
||
<pre><code>$ docker build -t dry-run-test .
|
||
</code></pre>
|
||
|
||
<p>The <code>docker build</code> command returns informational message as it runs. The
|
||
first build may take a few minutes to create an image. Using the
|
||
instructions in the <code>Dockerfile</code>, the build may need to download source and
|
||
other images. A successful build returns a final status message similar to
|
||
the following:</p>
|
||
|
||
<pre><code>Successfully built 676815d59283
|
||
</code></pre></li>
|
||
|
||
<li><p>List your Docker images again.</p>
|
||
|
||
<pre><code>$ docker images
|
||
</code></pre>
|
||
|
||
<p>You should see something similar to this:</p>
|
||
|
||
<table class="code">
|
||
<tr>
|
||
<th>REPOSTITORY</th>
|
||
<th>TAG</th>
|
||
<th>IMAGE ID</th>
|
||
<th>CREATED</th>
|
||
<th>VIRTUAL SIZE</th>
|
||
</tr>
|
||
<tr>
|
||
<td>dry-run-test</td>
|
||
<td>latest</td>
|
||
<td>663fbee70028</td>
|
||
<td>About a minute ago</td>
|
||
<td></td>
|
||
</tr>
|
||
<tr>
|
||
<td>ubuntu</td>
|
||
<td>trusty</td>
|
||
<td>2d24f826cb16</td>
|
||
<td>2 days ago</td>
|
||
<td>188.3 MB</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ubuntu</td>
|
||
<td>trusty-20150218.1</td>
|
||
<td>2d24f826cb16</td>
|
||
<td>2 days ago</td>
|
||
<td>188.3 MB</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ubuntu</td>
|
||
<td>14.04</td>
|
||
<td>2d24f826cb16</td>
|
||
<td>2 days ago</td>
|
||
<td>188.3 MB</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ubuntu</td>
|
||
<td>14.04.2</td>
|
||
<td>2d24f826cb16</td>
|
||
<td>2 days ago</td>
|
||
<td>188.3 MB</td>
|
||
</tr>
|
||
<tr>
|
||
<td>ubuntu</td>
|
||
<td>latest</td>
|
||
<td>2d24f826cb16</td>
|
||
<td>2 days ago</td>
|
||
<td>188.3 MB</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<p>Locate your new <code>dry-run-test</code> image in the list. You should also see a
|
||
number of <code>ubuntu</code> images. The build process creates these. They are the
|
||
ancestors of your new Docker development image. When you next rebuild your
|
||
image, the build process reuses these ancestors images if they exist.</p>
|
||
|
||
<p>Keeping the ancestor images improves the build performance. When you rebuild
|
||
the child image, the build process uses the local ancestors rather than
|
||
retrieving them from the Hub. The build process gets new ancestors only if
|
||
DockerHub has updated versions.</p></li>
|
||
</ol>
|
||
|
||
<h2 id="start-a-container-and-run-a-test">Start a container and run a test</h2>
|
||
|
||
<p>At this point, you have created a new Docker development environment image. Now,
|
||
you&rsquo;ll use this image to create a Docker container to develop in. Then, you&rsquo;ll
|
||
build and run a <code>docker</code> binary in your container.</p>
|
||
|
||
<ol>
|
||
<li><p>Open two additional terminals on your host.</p>
|
||
|
||
<p>At this point, you&rsquo;ll have about three terminals open.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/three_terms.png" alt="Multiple terminals" />
|
||
</p>
|
||
|
||
<p>Mac OS X users, make sure you run <code>eval &quot;$(boot2docker shellinit)&quot;</code> in any new
|
||
terminals.</p></li>
|
||
|
||
<li><p>In a terminal, create a new container from your <code>dry-run-test</code> image.</p>
|
||
|
||
<pre><code>$ docker run --privileged --rm -ti dry-run-test /bin/bash
|
||
root@5f8630b873fe:/go/src/github.com/docker/docker#
|
||
</code></pre>
|
||
|
||
<p>The command creates a container from your <code>dry-run-test</code> image. It opens an
|
||
interactive terminal (<code>-ti</code>) running a <code>/bin/bash</code> shell. The
|
||
<code>--privileged</code> flag gives the container access to kernel features and device
|
||
access. This flag allows you to run a container in a container.
|
||
Finally, the <code>-rm</code> flag instructs Docker to remove the container when you
|
||
exit the <code>/bin/bash</code> shell.</p>
|
||
|
||
<p>The container includes the source of your image repository in the
|
||
<code>/go/src/github.com/docker/docker</code> directory. Try listing the contents to
|
||
verify they are the same as that of your <code>docker-fork</code> repo.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/list_example.png" alt="List example" />
|
||
</p></li>
|
||
|
||
<li><p>Investigate your container bit.</p>
|
||
|
||
<p>If you do a <code>go version</code> you&rsquo;ll find the <code>go</code> language is part of the
|
||
container.</p>
|
||
|
||
<pre><code>root@31ed86e9ddcf:/go/src/github.com/docker/docker# go version
|
||
go version go1.4.2 linux/amd64
|
||
</code></pre>
|
||
|
||
<p>Similarly, if you do a <code>docker version</code> you find the container
|
||
has no <code>docker</code> binary.</p>
|
||
|
||
<pre><code>root@31ed86e9ddcf:/go/src/github.com/docker/docker# docker version
|
||
bash: docker: command not found
|
||
</code></pre>
|
||
|
||
<p>You will create one in the next steps.</p></li>
|
||
|
||
<li><p>From the <code>/go/src/github.com/docker/docker</code> directory make a <code>docker</code> binary
|
||
with the <code>make.sh</code> script.</p>
|
||
|
||
<pre><code>root@5f8630b873fe:/go/src/github.com/docker/docker# hack/make.sh binary
|
||
</code></pre>
|
||
|
||
<p>You only call <code>hack/make.sh</code> to build a binary <em>inside</em> a Docker
|
||
development container as you are now. On your host, you&rsquo;ll use <code>make</code>
|
||
commands (more about this later).</p>
|
||
|
||
<p>As it makes the binary, the <code>make.sh</code> script reports the build&rsquo;s progress.
|
||
When the command completes successfully, you should see the following
|
||
output:</p>
|
||
|
||
<p>&mdash;&gt; Making bundle: binary (in bundles/1.5.0-dev/binary)
|
||
Created binary: /go/src/github.com/docker/docker/bundles/1.5.0-dev/binary/docker-1.5.0-dev</p></li>
|
||
|
||
<li><p>List all the contents of the <code>binary</code> directory.</p>
|
||
|
||
<pre><code>root@5f8630b873fe:/go/src/github.com/docker/docker# ls bundles/1.5.0-dev/binary/
|
||
docker docker-1.5.0-dev docker-1.5.0-dev.md5 docker-1.5.0-dev.sha256
|
||
</code></pre>
|
||
|
||
<p>You should see that <code>binary</code> directory, just as it sounds, contains the
|
||
made binaries.</p></li>
|
||
|
||
<li><p>Copy the <code>docker</code> binary to the <code>/usr/bin</code> of your container.</p>
|
||
|
||
<pre><code>root@5f8630b873fe:/go/src/github.com/docker/docker# cp bundles/1.5.0-dev/binary/docker /usr/bin
|
||
</code></pre></li>
|
||
|
||
<li><p>Inside your container, check your Docker version.</p>
|
||
|
||
<pre><code>root@5f8630b873fe:/go/src/github.com/docker/docker# docker --version
|
||
Docker version 1.5.0-dev, build 6e728fb
|
||
</code></pre>
|
||
|
||
<p>Inside the container you are running a development version. This is the version
|
||
on the current branch. It reflects the value of the <code>VERSION</code> file at the
|
||
root of your <code>docker-fork</code> repository.</p></li>
|
||
|
||
<li><p>Start a <code>docker</code> daemon running inside your container.</p>
|
||
|
||
<pre><code>root@5f8630b873fe:/go/src/github.com/docker/docker# docker -dD
|
||
</code></pre>
|
||
|
||
<p>The <code>-dD</code> flag starts the daemon in debug mode. You&rsquo;ll find this useful
|
||
when debugging your code.</p></li>
|
||
|
||
<li><p>Bring up one of the terminals on your local host.</p></li>
|
||
|
||
<li><p>List your containers and look for the container running the <code>dry-run-test</code> image.</p>
|
||
|
||
<pre><code>$ docker ps
|
||
</code></pre>
|
||
|
||
<table class="code">
|
||
<tr>
|
||
<th>CONTAINER ID</th>
|
||
<th>IMAGE</th>
|
||
<th>COMMAND</th>
|
||
<th>CREATED</th>
|
||
<th>STATUS</th>
|
||
<th>PORTS</th>
|
||
<th>NAMES</th>
|
||
</tr>
|
||
<tr>
|
||
<td>474f07652525</td>
|
||
<td>dry-run-test:latest</td>
|
||
<td>"hack/dind /bin/bash</td>
|
||
<td>14 minutes ago</td>
|
||
<td>Up 14 minutes</td>
|
||
<td></td>
|
||
<td>tender_shockley</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<p>In this example, the container&rsquo;s name is <code>tender_shockley</code>; yours will be
|
||
different.</p></li>
|
||
|
||
<li><p>From the terminal, start another shell on your Docker development container.</p>
|
||
|
||
<pre><code>$ docker exec -it tender_shockley bash
|
||
</code></pre>
|
||
|
||
<p>At this point, you have two terminals both with a shell open into your
|
||
development container. One terminal is running a debug session. The other
|
||
terminal is displaying a <code>bash</code> prompt.</p></li>
|
||
|
||
<li><p>At the prompt, test the Docker client by running the <code>hello-world</code> container.</p>
|
||
|
||
<pre><code>root@9337c96e017a:/go/src/github.com/docker/docker# docker run hello-world
|
||
</code></pre>
|
||
|
||
<p>You should see the image load and return. Meanwhile, you
|
||
can see the calls made via the debug session in your other terminal.</p>
|
||
|
||
<p><img src="http://localhost/project/project/project/images/three_running.png" alt="List example" />
|
||
</p></li>
|
||
</ol>
|
||
|
||
<h2 id="restart-a-container-with-your-source">Restart a container with your source</h2>
|
||
|
||
<p>At this point, you have experienced the &ldquo;Docker inception&rdquo; technique. That is,
|
||
you have:</p>
|
||
|
||
<ul>
|
||
<li>built a Docker image from the Docker repository</li>
|
||
<li>created and started a Docker development container from that image</li>
|
||
<li>built a Docker binary inside of your Docker development container</li>
|
||
<li>launched a <code>docker</code> daemon using your newly compiled binary</li>
|
||
<li>called the <code>docker</code> client to run a <code>hello-world</code> container inside
|
||
your development container</li>
|
||
</ul>
|
||
|
||
<p>When you really get to developing code though, you&rsquo;ll want to iterate code
|
||
changes and builds inside the container. For that you need to mount your local
|
||
Docker repository source into your Docker container. Try that now.</p>
|
||
|
||
<ol>
|
||
<li><p>If you haven&rsquo;t already, exit out of BASH shells in your running Docker
|
||
container.</p>
|
||
|
||
<p>If you have followed this guide exactly, exiting out your BASH shells stops
|
||
the running container. You can use the <code>docker ps</code> command to verify the
|
||
development container is stopped. All of your terminals should be at the
|
||
local host prompt.</p></li>
|
||
|
||
<li><p>Choose a terminal and make sure you are in your <code>docker-fork</code> repository.</p>
|
||
|
||
<pre><code>$ pwd
|
||
/Users/mary/go/src/github.com/moxiegirl/docker-fork
|
||
</code></pre>
|
||
|
||
<p>Your location will be different because it reflects your environment.</p></li>
|
||
|
||
<li><p>Create a container using <code>dry-run-test</code>, but this time, mount your repository
|
||
onto the <code>/go</code> directory inside the container.</p>
|
||
|
||
<pre><code>$ docker run --privileged --rm -ti -v `pwd`:/go/src/github.com/docker/docker dry-run-test /bin/bash
|
||
</code></pre>
|
||
|
||
<p>When you pass <code>pwd</code>, <code>docker</code> resolves it to your current directory.</p></li>
|
||
|
||
<li><p>From inside the container, list your <code>binary</code> directory.</p>
|
||
|
||
<pre><code>root@074626fc4b43:/go/src/github.com/docker/docker# ls bundles/1.5.0-dev/binary
|
||
ls: cannot access binary: No such file or directory
|
||
</code></pre>
|
||
|
||
<p>Your <code>dry-run-test</code> image does not retain any of the changes you made inside
|
||
the container. This is the expected behavior for a container.</p></li>
|
||
|
||
<li><p>In a fresh terminal on your local host, change to the <code>docker-fork</code> root.</p>
|
||
|
||
<pre><code>$ cd ~/repos/docker-fork/
|
||
</code></pre></li>
|
||
|
||
<li><p>Create a fresh binary, but this time, use the <code>make</code> command.</p>
|
||
|
||
<pre><code>$ make BINDDIR=. binary
|
||
</code></pre>
|
||
|
||
<p>The <code>BINDDIR</code> flag is only necessary on Mac OS X but it won&rsquo;t hurt to pass
|
||
it on Linux command line. The <code>make</code> command, like the <code>make.sh</code> script
|
||
inside the container, reports its progress. When the make succeeds, it
|
||
returns the location of the new binary.</p></li>
|
||
|
||
<li><p>Back in the terminal running the container, list your <code>binary</code> directory.</p>
|
||
|
||
<pre><code>root@074626fc4b43:/go/src/github.com/docker/docker# ls bundles/1.5.0-dev/binary
|
||
docker docker-1.5.0-dev docker-1.5.0-dev.md5 docker-1.5.0-dev.sha256
|
||
</code></pre>
|
||
|
||
<p>The compiled binaries created from your repository on your local host are
|
||
now available inside your running Docker development container.</p></li>
|
||
|
||
<li><p>Repeat the steps you ran in the previous procedure.</p>
|
||
|
||
<ul>
|
||
<li>copy the binary inside the development container using
|
||
<code>cp bundles/1.5.0-dev/binary/docker /usr/bin</code></li>
|
||
<li>start <code>docker -dD</code> to launch the Docker daemon inside the container</li>
|
||
<li>run <code>docker ps</code> on local host to get the development container&rsquo;s name</li>
|
||
<li>connect to your running container <code>docker exec -it container_name bash</code></li>
|
||
<li>use the <code>docker run hello-world</code> command to create and run a container
|
||
inside your development container</li>
|
||
</ul></li>
|
||
</ol>
|
||
|
||
<h2 id="where-to-go-next">Where to go next</h2>
|
||
|
||
<p>Congratulations, you have successfully achieved Docker inception. At this point,
|
||
you&rsquo;ve set up your development environment and verified almost all the essential
|
||
processes you need to contribute. Of course, before you start contributing,
|
||
<a href="http://localhost/project/project/project/test-and-docs/">you&rsquo;ll need to learn one more piece of the development environment, the test
|
||
framework</a>.</p>
|
||
</description>
|
||
</item>
|
||
|
||
</channel>
|
||
</rss> |