1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Moving project to docker/opensource

Signed-off-by: Mary Anthony <mary@docker.com>
This commit is contained in:
Mary Anthony 2015-10-31 19:50:19 -07:00
parent e2e2ea401a
commit e400125b66
54 changed files with 0 additions and 2957 deletions

View file

@ -1,159 +0,0 @@
<!--[metadata]>
+++
title = "Advanced contributing"
description = "Explains workflows for refactor and design proposals"
keywords = ["contribute, project, design, refactor, proposal"]
[menu.main]
parent = "smn_contribute"
weight=6
+++
<![end-metadata]-->
# Advanced contributing
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't be scared off though, if you like to stretch and
challenge yourself, this is the place for you.
This section gives generalized instructions for advanced contributions. You'll
read about the workflow but there are not specific descriptions of commands.
Your goal should be to understand the processes described.
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>.
## Refactor or cleanup proposal
A refactor or cleanup proposal changes Docker's internal structure without
altering the external behavior. To make this type of proposal:
1. Fork `docker/docker`.
2. Make your changes in a feature branch.
3. Sync and rebase with `master` as you work.
3. Run the full test suite.
4. Submit your code through a pull request (PR).
The PR's title should have the format:
**Cleanup:** _short title_
If your changes required logic changes, note that in your request.
5. Work through Docker's review process until merge.
## Design proposal
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.
![Simple process](images/proposal.png)
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.
The following provides greater detail on the process:
1. Come up with an idea.
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.
2. Review existing issues and proposals to make sure no other user is proposing a similar idea.
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>.
3. Talk to the community about your idea.
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.
4. Fork `docker/docker` and clone the repo to your local host.
5. Create a new Markdown file in the area you wish to change.
For example, if you want to redesign our daemon create a new file under the
`daemon/` folder.
6. Name the file descriptively, for example `redesign-daemon-proposal.md`.
7. Write a proposal for your change into the file.
This is a Markdown file that describes your idea. Your proposal
should include information like:
* Why is this change needed or what are the use cases?
* What are the requirements this change should meet?
* What are some ways to design/implement this feature?
* Which design/implementation do you think is best and why?
* What are the risks or limitations of your proposal?
This is your chance to convince people your idea is sound.
8. Submit your proposal in a pull request to `docker/docker`.
The title should have the format:
**Proposal:** _short title_
The body of the pull request should include a brief summary of your change
and then say something like "_See the file for a complete description_".
9. Refine your proposal through review.
The maintainers and the community review your proposal. You'll need to
answer questions and sometimes explain or defend your approach. This is
chance for everyone to both teach and learn.
10. Pull request accepted.
Your request may also be rejected. Not every idea is a good fit for Docker.
Let's assume though your proposal succeeded.
11. Implement your idea.
Implementation uses all the standard practices of any contribution.
* fork `docker/docker`
* create a feature branch
* sync frequently back to master
* test as you go and full test before a PR
If you run into issues, the community is there to help.
12. When you have a complete implementation, submit a pull request back to `docker/docker`.
13. Review and iterate on your code.
If you are making a large code change, you can expect greater scrutiny
during this phase.
14. Acceptance and merge!
## About the advanced process
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.
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
While proposals in pull requests do not end up merged into a master repository, they provide a convenient tool for managing the design process.

View file

@ -1,103 +0,0 @@
<!--[metadata]>
+++
title = "Coding style checklist"
description = "List of guidelines for coding Docker contributions"
keywords = ["change, commit, squash, request, pull request, test, unit test, integration tests, Go, gofmt, LGTM"]
[menu.main]
parent = "smn_contribute"
weight=7
+++
<![end-metadata]-->
# Coding style checklist
This checklist summarizes the material you experienced working through [make a
code contribution](make-a-contribution.md) and [advanced
contributing](advanced-contributing.md). The checklist applies to both
program code and documentation code.
## Change and commit code
* Fork the `docker/docker` repository.
* Make changes on your fork in a feature branch. Name your branch `XXXX-something`
where `XXXX` is the issue number you are working on.
* Run `gofmt -s -w file.go` on each changed file before
committing your changes. Most editors have plug-ins that do this automatically.
* Run `golint` on each changed file before
committing your changes.
* Update the documentation when creating or modifying features.
* Commits that fix or close an issue should reference them in the commit message
`Closes #XXXX` or `Fixes #XXXX`. Mentions help by automatically closing the
issue on a merge.
* After every commit, run the test suite and ensure it is passing.
* Sync and rebase frequently as you code to keep up with `docker` master.
* Set your `git` signature and make sure you sign each commit.
* Do not add yourself to the `AUTHORS` file. This file is autogenerated from the
Git history.
## Tests and testing
* Submit unit tests for your changes.
* Make use of the builtin Go test framework built.
* Use existing Docker test files (`name_test.go`) for inspiration.
* Run <a href="../test-and-docs/" target="_blank">the full test suite</a> on your
branch before submitting a pull request.
* Run `make docs` to build the documentation and then check it locally.
* 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.
## Pull requests
* Sync and cleanly rebase on top of Docker's `master` without multiple branches
mixed into the PR.
* Before the pull request, squash your commits into logical units of work using
`git rebase -i` and `git push -f`.
* Include documentation changes in the same commit so that a revert would
remove all traces of the feature or fix.
* Reference each issue in your pull request description (`#XXXX`)
## Respond to pull requests reviews
* Docker maintainers use LGTM (**l**ooks-**g**ood-**t**o-**m**e) in PR comments
to indicate acceptance.
* Code review comments may be added to your pull request. Discuss, then make
the suggested modifications and push additional commits to your feature
branch.
* Incorporate changes on your feature branch and push to your fork. This
automatically updates your open pull request.
* Post a comment after pushing to alert reviewers to PR changes; pushing a
change does not send notifications.
* A change requires LGTMs from an absolute majority maintainers of an
affected component. For example, if you change `docs/` and `registry/` code,
an absolute majority of the `docs/` and the `registry/` maintainers must
approve your PR.
## Merges after pull requests
* After a merge, [a master build](https://master.dockerproject.org/) is
available almost immediately.
* If you made a documentation change, you can see it at
[docs.master.dockerproject.org](http://docs.master.dockerproject.org/).

View file

@ -1,138 +0,0 @@
<!--[metadata]>
+++
title = "Create a pull request (PR)"
description = "Basic workflow for Docker contributions"
keywords = ["contribute, pull request, review, workflow, beginner, squash, commit"]
[menu.main]
parent = "smn_contribute"
weight=4
+++
<![end-metadata]-->
# Create a pull request (PR)
A pull request (PR) sends your changes to the Docker maintainers for review. You
create a pull request on GitHub. A pull request "pulls" changes from your forked
repository into the `docker/docker` repository.
You can see <a href="https://github.com/docker/docker/pulls" target="_blank">the
list of active pull requests to Docker</a> on GitHub.
## Check your work
Before you create a pull request, check your work.
1. In a terminal window, go to the root of your `docker-fork` repository.
$ cd ~/repos/docker-fork
2. Checkout your feature branch.
$ git checkout 11038-fix-rhel-link
Switched to branch '11038-fix-rhel-link'
3. Run the full test suite on your branch.
$ make test
All the tests should pass. If they don't, find out why and correct the
situation.
4. Optionally, if modified the documentation, build the documentation:
$ make docs
5. Commit and push any changes that result from your checks.
## Rebase your branch
Always rebase and squash your commits before making a pull request.
1. Checkout your feature branch in your local `docker-fork` repository.
This is the branch associated with your request.
2. Fetch any last minute changes from `docker/docker`.
$ git fetch upstream master
From github.com:docker/docker
* branch master -> FETCH_HEAD
3. Start an interactive rebase.
$ git rebase -i upstream/master
4. Rebase opens an editor with a list of commits.
pick 1a79f55 Tweak some of the other text for grammar
pick 53e4983 Fix a link
pick 3ce07bb Add a new line about RHEL
5. Replace the `pick` keyword with `squash` on all but the first commit.
pick 1a79f55 Tweak some of the other text for grammar
squash 53e4983 Fix a link
squash 3ce07bb Add a new line about RHEL
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.
6. Edit and save your commit message.
$ git commit -s
Make sure your message includes <a href="../set-up-git" target="_blank">your signature</a>.
7. Force push any changes to your fork on GitHub.
$ git push -f origin 11038-fix-rhel-link
## Create a PR on GitHub
You create and manage PRs on GitHub:
1. Open your browser to your fork on GitHub.
You should see the latest activity from your branch.
![Latest commits](images/latest_commits.png)
2. Click "Compare & pull request."
The system displays the pull request dialog.
![PR dialog](images/to_from_pr.png)
The pull request compares your changes to the `master` branch on the
`docker/docker` repository.
3. Edit the dialog's description and add a reference to the issue you are fixing.
GitHub helps you out by searching for the issue as you type.
![Fixes issue](images/fixes_num.png)
4. Scroll down and verify the PR contains the commits and changes you expect.
For example, is the file count correct? Are the changes in the files what
you expect?
![Commits](images/commits_expected.png)
5. Press "Create pull request".
The system creates the request and opens it for you in the `docker/docker`
repository.
![Pull request made](images/pull_request_made.png)
## Where to go next
Congratulations, you've created your first pull request to Docker. The next
step is for you learn how to [participate in your PR's
review](review-pr.md).

View file

@ -1,283 +0,0 @@
<!--[metadata]>
+++
title = "Style guide for Docker documentation"
description = "Style guide for Docker documentation describing standards and conventions for contributors"
keywords = ["style, guide, docker, documentation"]
[menu.main]
parent = "mn_opensource"
weight=100
+++
<![end-metadata]-->
# Docker documentation: style & grammar conventions
## Style standards
Over time, different publishing communities have written standards for the style
and grammar they prefer in their publications. These standards are called
[style guides](http://en.wikipedia.org/wiki/Style_guide). Generally, Dockers
documentation uses the standards described in the
[Associated Press's (AP) style guide](http://en.wikipedia.org/wiki/AP_Stylebook).
If a question about syntactical, grammatical, or lexical practice comes up,
refer to the AP guide first. If you dont 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 cant find an answer, please ask a
[maintainer](https://github.com/docker/docker/blob/master/MAINTAINERS) and
we will find the answer.
That said, please don't get too hung up on using correct style. We'd rather have
you submit good information that doesn't conform to the guide than no
information at all. Docker's tech writers are always happy to help you with the
prose, and we promise not to judge or use a red pen!
> **Note:**
> 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.
### Prose style
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
"use" instead of leveraging "leverage".
That said, dont 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.
One way to think about this is to assume Dockers users are generally university
educated and read at at least a "16th" grade level (meaning they have a
university degree). You can use a [readability
tester](https://readability-score.com/) to help guide your judgement. For
example, the readability score for the phrase "Containers should be ephemeral"
is around the 13th grade level (first year at university), and so is acceptable.
In all cases, we prefer clear, concise communication over stilted, formal
language. Don't feel like you have to write documentation that "sounds like
technical writing."
### Metaphor and figurative language
One exception to the "dont write directly for ESL" rule is to avoid the use of
metaphor or other
[figurative language](http://en.wikipedia.org/wiki/Literal_and_figurative_language) to
describe things. There are too many cultural and social issues that can prevent
a reader from correctly interpreting a metaphor.
## Specific conventions
Below are some specific recommendations (and a few deviations) from AP style
that we use in our docs.
### Contractions
As long as your prose does not become too slangy or informal, it's perfectly
acceptable to use contractions in our documentation. Make sure to use
apostrophes correctly.
### Use of dashes in a sentence.
Dashes refers to the en dash () and the em dash (—). Dashes can be used to
separate parenthetical material.
Usage Example: This is an example of a Docker client which uses the Big Widget
to run and does x, y, and z.
Use dashes cautiously and consider whether commas or parentheses would work just
as well. We always emphasize short, succinct sentences.
More info from the always handy [Grammar Girl site](http://www.quickanddirtytips.com/education/grammar/dashes-parentheses-and-commas).
### Pronouns
It's okay to use first and second person pronouns, especially if it lets you avoid a passive construction. Specifically, always use "we" to
refer to Docker and "you" to refer to the user. For example, "We built the
`exec` command so you can resize a TTY session." That said, in general, try to write simple, imperative sentences that avoid the use of pronouns altogether. Say "Now, enter your SSH key" rather than "You can now enter your SSH key."
As much as possible, avoid using gendered pronouns ("he" and "she", etc.).
Either recast the sentence so the pronoun is not needed or, less preferably,
use "they" instead. If you absolutely can'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's gender, but if you prefer to
default to "he" or "she", that's fine too.
### Capitalization
#### In general
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 "specialness".
The word "Docker" 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.
#### Starting sentences
Because code samples should always be written exactly as they would appear
on-screen, you should avoid starting sentences with a code sample.
#### In headings
Headings take sentence capitalization, meaning that only the first letter is
capitalized (and words that would normally be capitalized in a sentence, e.g.,
"Docker"). Do not use Title Case (i.e., capitalizing every word) for headings. Generally, we adhere to [AP style
for titles](http://www.quickanddirtytips.com/education/grammar/capitalizing-titles).
### Periods
We prefer one space after a period at the end of a sentence, not two.
See [lists](#lists) below for how to punctuate list items.
### Abbreviations and acronyms
* Exempli gratia (e.g.) and id est ( i.e.): these should always have periods and
are always followed by a comma.
* Acronyms are pluralized by simply adding "s", e.g., PCs, OSs.
* 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.
* Other than "e.g." and "i.e." (as discussed above), acronyms do not take
periods, PC not P.C.
### Lists
When writing lists, keep the following in mind:
Use bullets when the items being listed are independent of each other and the
order of presentation is not important.
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 "There are three config
settings available for SSL, as follows:", you would number each config setting
in the subsequent list.
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.
### Numbers
Write out numbers in body text and titles from one to ten. From 11 on, use numerals.
### Notes
Use notes sparingly and only to bring things to the reader's attention that are
critical or otherwise deserving of being called out from the body text. Please
format all notes as follows:
> **Note:**
> One line of note text
> another line of note text
### Avoid excess use of "i.e."
Minimize your use of "i.e.". It can add an unnecessary interpretive burden on
the reader. Avoid writing "This is a thing, i.e., it is like this". Just
say what it is: "This thing is …"
### Preferred usages
#### Login vs. log in.
A "login" is a noun (one word), as in "Enter your login". "Log in" is a compound
verb (two words), as in "Log in to the terminal".
### Oxford comma
One way in which we differ from AP style is that Dockers docs use the [Oxford
comma](http://en.wikipedia.org/wiki/Serial_comma) in all cases. Thats our
position on this controversial topic, we won't change our mind, and thats that!
### Code and UI text styling
We require `code font` 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., `/etc/hosts/docker.conf`). If you enclose text in backticks (`) markdown
will style the text as code.
Text from a CLI should be quoted verbatim, even if it contains errors or its
style contradicts this guide. You can add "(sic)" after the quote to indicate
the errors are in the quote and are not errors in our docs.
Text taken from a GUI (e.g., menu text or button text) should appear in "double
quotes". The text should take the exact same capitalisation, etc. as appears in
the GUI. E.g., Click "Continue" to save the settings.
Text that refers to a keyboard command or hotkey is capitalized (e.g., Ctrl-D).
When writing CLI examples, give the user hints by making the examples resemble
exactly what they see in their shell:
* Indent shell examples by 4 spaces so they get rendered as code blocks.
* Start typed commands with `$ ` (dollar space), so that they are easily
differentiated from program output.
* Program output has no prefix.
* Comments begin with # (hash space).
* In-container shell commands, begin with `$$ ` (dollar dollar space).
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.
## Pull requests
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:
* Explain why the change is needed
* Point out potential issues or questions
* Ask for help from experts in the company or the community
* Encourage feedback from core developers and others involved in creating the
software being documented.
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.
### Commit messages
In order to write clear, useful commit messages, please follow these
[recommendations](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message).
## Links
For accessibility and usability reasons, avoid using phrases such as "click
here" for link text. Recast your sentence so that the link text describes the
content of the link, as we did in the
["Commit messages" section](#commit-messages) above.
You can use relative links (../linkeditem) to link to other pages in Docker's
documentation.
## Graphics
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.
The preferred file format for graphics is PNG, but GIF and JPG are also
acceptable.
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 youre referring to.
Line width for call-outs should not exceed five pixels. The preferred color for
call-outs is red.
Be sure to include descriptive alt-text for the graphic. This greatly helps
users with accessibility issues.
Lastly, be sure you have permission to use any included graphics.

View file

@ -1,237 +0,0 @@
<!--[metadata]>
+++
title = "Find and claim an issue"
description = "Basic workflow for Docker contributions"
keywords = ["contribute, issue, review, workflow, beginner, expert, squash, commit"]
[menu.main]
parent = "smn_contribute"
weight=2
+++
<![end-metadata]-->
<style type="text/css">
.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);
}
.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; }
.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; }
</style>
# Find and claim an issue
On this page, you choose the issue 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.
## Understand the issue types
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.
Triaged issues have one of these labels:
<table class="tg">
<thead>
<tr>
<td class="tg-031e">Label</td>
<td class="tg-031e">Experience level guideline</td>
</tr>
</thead>
<tbody>
<tr>
<td class="tg-031e"><strong class="gh-label beginner">exp/beginner</strong></td>
<td class="tg-031e">You have made less than ten 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 ten 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 five 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>
</tbody>
</table>
These labels are 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 issue.
## Claim a beginner or novice issue
To claim an issue:
1. Go to the `docker/docker` <a
href="https://github.com/docker/docker" target="_blank">repository</a>.
2. Click the "Issues" link.
A list of the open issues appears.
![Open issues](images/issue_list.png)
3. From the "Labels" drop-down, select <strong class="gh-label beginner">exp/beginner</strong>.
The system filters to show only open <strong class="gh-label beginner">exp/beginner</strong> issues.
4. Open an issue that interests you.
The comments on the issues describe the problem and can provide information for a potential
solution.
5. When you find an open issue that both interests you and is unclaimed, add a
`#dibs` comment. Make sure that no other user has chosen to work on the issue.
The project does not permit external contributors to assign issues to themselves. Read
the comments to find if a user claimed the issue by leaving a
`#dibs` comment on the issue.
7. Your issue # will be different depending on what you claimed. After a moment, Gordon the Docker
bot, changes the issue status to claimed. The following example shows issue #11038.
![Easy issue](images/easy_issue.png)
8. Make a note of the issue number; you will need it for later.
## Sync your fork and create a new branch
If you have followed along in this guide, you forked the `docker/docker`
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
`docker/docker` master. Syncing ensures your repository has the latest
changes.
To sync your repository:
1. Open a terminal on your local host.
2. Change directory to the `docker-fork` root.
$ cd ~/repos/docker-fork
3. Checkout the master branch.
$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Recall that `origin/master` is a branch on your remote GitHub repository.
4. Make sure you have the upstream remote `docker/docker` by listing them.
$ 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)
If the `upstream` is missing, add it.
$ git remote add upstream https://github.com/docker/docker.git
5. Fetch all the changes from the `upstream master` branch.
$ 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 -> FETCH_HEAD
This command says get all the changes from the `master` branch belonging to
the `upstream` remote.
7. Rebase your local master with the `upstream/master`.
$ git rebase upstream/master
First, rewinding head to replay your work on top of it...
Fast-forwarded master to upstream/master.
This command applies all the commits from the upstream master to your local
master.
8. Check the status of your local branch.
$ git status
On branch master
Your branch is ahead of 'origin/master' by 38 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
Your local repository now has all the changes from the `upstream` remote. You
need to push the changes to your own remote fork which is `origin master`.
9. Push the rebased master to `origin master`.
$ 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 -> master
9. Create a new feature branch to work on your issue.
Your branch name should have the format `XXXX-descriptive` where `XXXX` is
the issue number you are working on. For example:
$ git checkout -b 11038-fix-rhel-link
Switched to a new branch '11038-fix-rhel-link'
Your branch should be up-to-date with the `upstream/master`. Why? Because you
branched off a freshly synced master. Let's check this anyway in the next
step.
9. Rebase your branch from upstream/master.
$ git rebase upstream/master
Current branch 11038-fix-rhel-link is up to date.
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.
## Where to go next
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 [how to work on your
changes](work-issue.md).

View file

@ -1,224 +0,0 @@
<!--[metadata]>
+++
title = "Where to chat or get help"
description = "Describes Docker's communication channels"
keywords = ["IRC, Google group, Twitter, blog, Stackoverflow"]
[menu.main]
parent = "mn_opensource"
+++
<![end-metadata]-->
<style type="text/css">
/* @TODO add 'no-zebra' table-style to the docs-base stylesheet */
/* Table without "zebra" striping */
.content-body table.no-zebra tr {
background-color: transparent;
}
</style>
# Where to chat or get help
There are several communications channels you can use to chat with Docker
community members and developers.
<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>chat.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>
Use our IRC quickstart guide below for easy ways to get started with IRC.
</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>
# IRC Quickstart
The following instructions show you how to register with two web based IRC
tools. Use one illustrated here or find another. While these instructions are
only for two IRC web clients there are many IRC Clients available on most
platforms.
## Webchat
Using Webchat from Freenode.net is a quick and easy way to get chatting. To
register:
1. In your browser open <a href="https://webchat.freenode.net" target="_blank">https://webchat.freenode.net</a>
![Login to webchat screen](images/irc_connect.png)
2. Fill out the form.
<table class="no-zebra" style="width: auto">
<tr>
<td><b>Nickname</b></td>
<td>The short name you want to be known as on IRC chat channels.</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>
3. Click on the "Connect" button.
The browser connects you to Webchat. You'll see a lot of text. At the bottom of
the Webchat web page is a command line bar. Just above the command line bar
a message is shown asking you to register.
![Registration needed screen](images/irc_after_login.png)
4. Register your nickname by entering the following command in the
command line bar:
/msg NickServ REGISTER yourpassword youremail@example.com
![Registering screen](images/register_nic.png)
This command line bar is also the entry field that you will use for entering
chat messages into IRC chat channels after you have registered and joined a
chat channel.
After entering the REGISTER command, an email is sent to the email address
that you provided. This email will contain instructions for completing
your registration.
5. Open your email client and look for the email.
![Login screen](images/register_email.png)
6. Back in the browser, complete the registration according to the email
by entering the following command into the webchat command line bar:
/msg NickServ VERIFY REGISTER yournickname somecode
Your nickname is now registered to chat on freenode.net.
[Jump ahead to tips to join a docker channel and start chatting](#tips)
## IRCCloud
IRCCloud is a web-based IRC client service that is hosted in the cloud. This is
a Freemium product, meaning the free version is limited and you can pay for more
features. To use IRCCloud:
1. Select the following link:
<a href="https://www.irccloud.com/invite?channel=%23docker&amp;hostname=chat.freenode.net&amp;port=6697" target="_blank">Join the #docker channel on chat.freenode.net</a>
The following web page is displayed in your browser:
![IRCCloud Register screen](images/irccloud-join.png)
2. If this is your first time using IRCCloud enter a valid email address in the
form. People who have already registered with IRCCloud can select the "sign in
here" link. Additionally, people who are already registered with IRCCloud may
have a cookie stored on their web browser that enables a quick start "let's go"
link to be shown instead of the above form. In this case just select the
"let's go" link and [jump ahead to start chatting](#start-chatting)
3. After entering your email address in the form, check your email for an invite
from IRCCloud and follow the instructions provided in the email.
4. After following the instructions in your email you should have an IRCCloud
Client web page in your browser:
![IRCCloud](images/irccloud-register-nick.png)
The message shown above may appear indicating that you need to register your
nickname.
5. To register your nickname enter the following message into the command line bar
at the bottom of the IRCCloud Client:
/msg NickServ REGISTER yourpassword youremail@example.com
This command line bar is for chatting and entering in IRC commands.
6. Check your email for an invite to freenode.net:
![Login screen](images/register_email.png)
7. Back in the browser, complete the registration according to the email.
/msg NickServ VERIFY REGISTER yournickname somecode
## Tips
The procedures in this section apply to both IRC clients.
### Set a nickname
Next time you return to log into chat, you may need to re-enter your password
on the command line using this command:
/msg NickServ identify <password>
With Webchat 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.
### Join a Docker Channel
Join the `#docker` group using the following command in the command line bar of
your IRC Client:
/j #docker
You can also join the `#docker-dev` group:
/j #docker-dev
### Start chatting
To ask questions to the group just type messages in the command line bar:
![Web Chat Screen](images/irc_chat.png)
## Learning more about IRC
This quickstart was meant to get you up and into IRC very quickly. If you find
IRC useful there is more to learn. Drupal, another open source project,
has <a href="https://www.drupal.org/irc/setting-up" target="_blank">
written some documentation about using IRC</a> for their project
(thanks Drupal!).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

View file

@ -1,41 +0,0 @@
<!--[metadata]>
+++
title = "Understand how to contribute"
description = "Explains basic workflow for Docker contributions"
keywords = ["contribute, maintainers, review, workflow, process"]
[menu.main]
parent = "smn_contribute"
+++
<![end-metadata]-->
# Understand how to contribute
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.
There is a formal process for contributing. We try to keep our contribution
process simple so you'll want to contribute frequently.
## The basic contribution workflow
In this guide, you work through Docker's basic contribution workflow by fixing a
single *beginner* issue in the `docker/docker` repository. The workflow
for fixing simple issues looks like this:
![Simple process](images/existing_issue.png)
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.
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.
## Where to go next
Now that you know a little about the contribution process, go to the next section
to [find an issue you want to work on](find-an-issue.md).

View file

@ -1,141 +0,0 @@
<!--[metadata]>
+++
title = "Participate in the PR review"
description = "Basic workflow for Docker contributions"
keywords = ["contribute, pull request, review, workflow, beginner, squash, commit"]
[menu.main]
parent = "smn_contribute"
weight=5
+++
<![end-metadata]-->
# Participate in the PR review
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.
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 "bots" and the
"beings" to review your contribution.
## How we process your review
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'll send an email through your GitHub user account:
![Gordon](images/gordon.jpeg)
Our build bot system starts building your changes while Gordon sends any emails.
The build system double-checks your work by compiling your code with Docker'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.
After Gordon and the bots, the "beings" review your work. Docker maintainers look
at your pull request and comment on it. The shortest comment you might see is
`LGTM` which means **l**ooks-**g**ood-**t**o-**m**e. If you get an `LGTM`, that
is a good thing, you passed that review.
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
"participates" in a PR receives an email to. Participating means creating or
commenting on a PR.
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'll
need to update your pull request with additional changes.
## Update an existing pull request
To update your existing pull request:
1. Checkout the PR branch in your local `docker-fork` repository.
This is the branch associated with your request.
2. Change one or more files and then stage your changes.
The command syntax is:
git add <path_or_filename>
3. Commit the change.
$ git commit --amend
Git opens an editor containing your last commit message.
4. Adjust your last comment to reflect this new change.
Added a new sentence per Anaud's suggestion
Signed-off-by: Mary Anthony <mary@docker.com>
# 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
5. Force push the change to your origin.
The command syntax is:
git push -f origin <branch_name>
6. Open your browser to your pull request on GitHub.
You should see your pull request now contains your newly pushed code.
7. Add a comment to your pull request.
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.
A change requires LGTMs from an absolute majority of an affected component's
maintainers. For example, if you change `docs/` and `registry/` code, an
absolute majority of the `docs/` and the `registry/` maintainers must approve
your PR. Once you get approval, we merge your pull request into Docker's
`master` code branch.
## After the merge
It can take time to see a merged pull request in Docker's official release.
A master build is available almost immediately though. Docker builds and
updates its development binaries after each merge to `master`.
1. Browse to <a href="https://master.dockerproject.org/" target="_blank">https://master.dockerproject.org/</a>.
2. Look for the binary appropriate to your system.
3. Download and run the binary.
You might want to run the binary in a container though. This
will keep your local host environment clean.
4. View any documentation changes at <a href="http://docs.master.dockerproject.org/" target="_blank">docs.master.dockerproject.org</a>.
Once you'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>.
## Where to go next
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.
If you are very experienced and want to make a major change, go on to
[learn about advanced contributing](advanced-contributing.md).

View file

@ -1,426 +0,0 @@
<!--[metadata]>
+++
title = "Work with a development container"
description = "How to use Docker's development environment"
keywords = ["development, inception, container, image Dockerfile, dependencies, Go, artifacts"]
[menu.main]
parent = "smn_develop"
weight=5
+++
<![end-metadata]-->
# Work with a development container
In this section, you learn to develop like a member of Docker's core team.
The `docker` repository includes a `Dockerfile` at its root. This file defines
Docker's development environment. The `Dockerfile` lists the environment's
dependencies: system libraries and binaries, Go environment, Go dependencies,
etc.
Docker's development environment is itself, ultimately a Docker container.
You use the `docker` repository and its `Dockerfile` 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.
If you followed the procedures that <a href="/engine/project/set-up-git" target="_blank">
set up Git for contributing</a>, you should have a fork of the `docker/docker`
repository. You also created a branch called `dry-run-test`. In this section,
you continue working with your fork on this branch.
## Clean your host of Docker artifacts
Docker developers run the latest stable release of the Docker software (with Docker Machine 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't strictly necessary, but it is
good practice, so it is included here.
To remove unnecessary artifacts:
1. Verify that you have no unnecessary containers running on your host.
$ docker ps
You should see something similar to the following:
<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>
There are no running containers on this host. If you have running but unused
containers, stop and then remove them with the `docker stop` and `docker rm`
commands.
2. Verify that your host has no dangling images.
$ docker images
You should see something similar to the following:
<table class="code">
<tr>
<th>REPOSITORY</th>
<th>TAG</th>
<th>IMAGE ID</th>
<th>CREATED</th>
<th>VIRTUAL SIZE</th>
</tr>
</table>
This host has no images. You may have one or more _dangling_ 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:
$ docker rmi -f $(docker images -q -a -f dangling=true)
This command uses `docker images` to list all images (`-a` flag) by numeric
IDs (`-q` flag) and filter them to find dangling images (`-f dangling=true`).
Then, the `docker rmi` command forcibly (`-f` flag) removes
the resulting list. To remove just one image, use the `docker rmi ID`
command.
## Build an image
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.
1. Open a terminal.
Mac users, use `docker-machine status your_vm_name` to make sure your VM is running. You
may need to run `eval "$(docker-machine env your_vm_name)"` to initialize your
shell environment.
3. Change into the root of your forked repository.
$ cd ~/repos/docker-fork
If you are following along with this guide, you created a `dry-run-test`
branch when you <a href="/engine/project/set-up-git" target="_blank"> set up Git for
contributing</a>.
4. Ensure you are on your `dry-run-test` branch.
$ git checkout dry-run-test
If you get a message that the branch doesn't exist, add the `-b` flag (git checkout -b dry-run-test) so the
command both creates the branch and checks it out.
5. Compile your development environment container into an image.
$ docker build -t dry-run-test .
The `docker build` command returns informational message as it runs. The
first build may take a few minutes to create an image. Using the
instructions in the `Dockerfile`, the build may need to download source and
other images. A successful build returns a final status message similar to
the following:
Successfully built 676815d59283
6. List your Docker images again.
$ docker images
You should see something similar to this:
<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>
Locate your new `dry-run-test` image in the list. You should also see a
number of `ubuntu` 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.
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
Docker Hub has updated versions.
## Start a container and run a test
At this point, you have created a new Docker development environment image. Now,
you'll use this image to create a Docker container to develop in. Then, you'll
build and run a `docker` binary in your container.
1. Open two additional terminals on your host.
At this point, you'll have about three terminals open.
![Multiple terminals](images/three_terms.png)
Mac OS X users, make sure you run `eval "$(docker-machine env your_vm_name)"` in
any new terminals.
2. In a terminal, create a new container from your `dry-run-test` image.
$ docker run --privileged --rm -ti dry-run-test /bin/bash
root@5f8630b873fe:/go/src/github.com/docker/docker#
The command creates a container from your `dry-run-test` image. It opens an
interactive terminal (`-ti`) running a `/bin/bash` shell. The
`--privileged` flag gives the container access to kernel features and device
access. This flag allows you to run a container in a container.
Finally, the `-rm` flag instructs Docker to remove the container when you
exit the `/bin/bash` shell.
The container includes the source of your image repository in the
`/go/src/github.com/docker/docker` directory. Try listing the contents to
verify they are the same as that of your `docker-fork` repo.
![List example](images/list_example.png)
3. Investigate your container bit.
If you do a `go version` you'll find the `go` language is part of the
container.
root@31ed86e9ddcf:/go/src/github.com/docker/docker# go version
go version go1.4.2 linux/amd64
Similarly, if you do a `docker version` you find the container
has no `docker` binary.
root@31ed86e9ddcf:/go/src/github.com/docker/docker# docker version
bash: docker: command not found
You will create one in the next steps.
4. From the `/go/src/github.com/docker/docker` directory make a `docker` binary
with the `make.sh` script.
root@5f8630b873fe:/go/src/github.com/docker/docker# hack/make.sh binary
You only call `hack/make.sh` to build a binary _inside_ a Docker
development container as you are now. On your host, you'll use `make`
commands (more about this later).
As it makes the binary, the `make.sh` script reports the build's progress.
When the command completes successfully, you should see the following
output:
---> 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
5. List all the contents of the `binary` directory.
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
You should see that `binary` directory, just as it sounds, contains the
made binaries.
6. Copy the `docker` binary to the `/usr/bin` of your container.
root@5f8630b873fe:/go/src/github.com/docker/docker# cp bundles/1.5.0-dev/binary/docker /usr/bin
7. Inside your container, check your Docker version.
root@5f8630b873fe:/go/src/github.com/docker/docker# docker --version
Docker version 1.5.0-dev, build 6e728fb
Inside the container you are running a development version. This is the version
on the current branch. It reflects the value of the `VERSION` file at the
root of your `docker-fork` repository.
8. Start a `docker` daemon running inside your container.
root@5f8630b873fe:/go/src/github.com/docker/docker# docker daemon -D
The `-D` flag starts the daemon in debug mode. You'll find this useful
when debugging your code.
9. Bring up one of the terminals on your local host.
10. List your containers and look for the container running the `dry-run-test` image.
$ docker ps
<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>
In this example, the container's name is `tender_shockley`; yours will be
different.
11. From the terminal, start another shell on your Docker development container.
$ docker exec -it tender_shockley bash
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 `bash` prompt.
12. At the prompt, test the Docker client by running the `hello-world` container.
root@9337c96e017a:/go/src/github.com/docker/docker# docker run hello-world
You should see the image load and return. Meanwhile, you
can see the calls made via the debug session in your other terminal.
![List example](images/three_running.png)
## Restart a container with your source
At this point, you have experienced the "Docker inception" technique. That is,
you have:
* built a Docker image from the Docker repository
* created and started a Docker development container from that image
* built a Docker binary inside of your Docker development container
* launched a `docker` daemon using your newly compiled binary
* called the `docker` client to run a `hello-world` container inside
your development container
When you really get to developing code though, you'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.
1. If you haven't already, exit out of BASH shells in your running Docker
container.
If you have followed this guide exactly, exiting out your BASH shells stops
the running container. You can use the `docker ps` command to verify the
development container is stopped. All of your terminals should be at the
local host prompt.
2. Choose a terminal and make sure you are in your `docker-fork` repository.
$ pwd
/Users/mary/go/src/github.com/moxiegirl/docker-fork
Your location will be different because it reflects your environment.
3. Create a container using `dry-run-test`, but this time, mount your repository
onto the `/go` directory inside the container.
$ docker run --privileged --rm -ti -v `pwd`:/go/src/github.com/docker/docker dry-run-test /bin/bash
When you pass `pwd`, `docker` resolves it to your current directory.
4. From inside the container, list your `binary` directory.
root@074626fc4b43:/go/src/github.com/docker/docker# ls bundles/1.5.0-dev/binary
ls: cannot access binary: No such file or directory
Your `dry-run-test` image does not retain any of the changes you made inside
the container. This is the expected behavior for a container.
5. In a fresh terminal on your local host, change to the `docker-fork` root.
$ cd ~/repos/docker-fork/
6. Create a fresh binary, but this time, use the `make` command.
$ make BINDDIR=. binary
The `BINDDIR` flag is only necessary on Mac OS X but it won't hurt to pass
it on Linux command line. The `make` command, like the `make.sh` script
inside the container, reports its progress. When the make succeeds, it
returns the location of the new binary.
7. Back in the terminal running the container, list your `binary` directory.
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
The compiled binaries created from your repository on your local host are
now available inside your running Docker development container.
8. Repeat the steps you ran in the previous procedure.
* copy the binary inside the development container using
`cp bundles/1.5.0-dev/binary/docker /usr/bin`
* start `docker daemon -D` to launch the Docker daemon inside the container
* run `docker ps` on local host to get the development container's name
* connect to your running container `docker exec -it container_name bash`
* use the `docker run hello-world` command to create and run a container
inside your development container
## Where to go next
Congratulations, you have successfully achieved Docker inception. At this point,
you've set up your development environment and verified almost all the essential
processes you need to contribute. Of course, before you start contributing,
[you'll need to learn one more piece of the development environment, the test
framework](test-and-docs.md).

View file

@ -1,248 +0,0 @@
<!--[metadata]>
+++
title = "Configure Git for contributing"
description = "Describes how to set up your local machine and repository"
keywords = ["GitHub account, repository, clone, fork, branch, upstream, Git, Go, make "]
[menu.main]
parent = "smn_develop"
weight=4
+++
<![end-metadata]-->
# Configure Git for contributing
Work through this page to configure Git and a repository you'll use throughout
the Contributor Guide. The work you do further in the guide, depends on the work
you do here.
## Fork and clone the Docker code
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.
As you make contributions, you change your fork's code. When you are ready,
you make a pull request back to the original Docker repository. If you aren't
familiar with this workflow, don't worry, this guide walks you through all the
steps.
To fork and clone Docker:
1. Open a browser and log into GitHub with your account.
2. Go to the <a href="https://github.com/docker/docker"
target="_blank">docker/docker repository</a>.
3. Click the "Fork" button in the upper right corner of the GitHub interface.
![Branch Signature](images/fork_docker.png)
GitHub forks the repository to your GitHub account. The original
`docker/docker` repository becomes a new fork `YOUR_ACCOUNT/docker` under
your account.
4. Copy your fork's clone URL from GitHub.
GitHub allows you to use HTTPS or SSH protocols for clones. You can use the
`git` command line or clients like Subversion to clone a repository.
![Copy clone URL](images/copy_url.png)
This guide assume you are using the HTTPS protocol and the `git` command
line. If you are comfortable with SSH and some other tool, feel free to use
that instead. You'll need to convert what you see in the guide to what is
appropriate to your tool.
5. Open a terminal window on your local host and change to your home directory.
$ cd ~
In Windows, you'll work in your Docker Quickstart Terminal window instead of
Powershell or a `cmd` window.
6. Create a `repos` directory.
$ mkdir repos
7. Change into your `repos` directory.
$ cd repos
5. Clone the fork to your local host into a repository called `docker-fork`.
$ git clone https://github.com/moxiegirl/docker.git docker-fork
Naming your local repo `docker-fork` should help make these instructions
easier to follow; experienced coders don't typically change the name.
6. Change directory into your new `docker-fork` directory.
$ cd docker-fork
Take a moment to familiarize yourself with the repository's contents. List
the contents.
## Set your signature and an upstream remote
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 `git` commits like this:
Signed-off-by: Pat Smith <pat.smith@email.com>
To create a signature, you configure your username and email address in Git.
You can set these globally or locally on just your `docker-fork` repository.
You must sign with your real name. We don't accept anonymous contributions or
contributions through pseudonyms.
As you change code in your fork, you'll want to keep it in sync with the changes
others make in the `docker/docker` repository. To make syncing easier, you'll
also add a _remote_ called `upstream` that points to `docker/docker`. A remote
is just another project version hosted on the internet or network.
To configure your username, email, and add a remote:
1. Change to the root of your `docker-fork` repository.
$ cd docker-fork
2. Set your `user.name` for the repository.
$ git config --local user.name "FirstName LastName"
3. Set your `user.email` for the repository.
$ git config --local user.email "emailname@mycompany.com"
4. Set your local repo to track changes upstream, on the `docker` repository.
$ git remote add upstream https://github.com/docker/docker.git
7. Check the result in your `git` configuration.
$ 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/*
To list just the remotes use:
$ 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)
## Create and push a branch
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.
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:
1. Open a terminal and go to the root of your `docker-fork`.
$ cd docker-fork
2. Create a `dry-run-test` branch.
$ git checkout -b dry-run-test
This command creates the branch and switches the repository to it.
3. Verify you are in your new branch.
$ git branch
* dry-run-test
master
The current branch has an * (asterisk) marker. So, these results shows you
are on the right branch.
4. Create a `TEST.md` file in the repository's root.
$ touch TEST.md
5. Edit the file and add your email and location.
![Add your information](images/contributor-edit.png)
You can use any text editor you are comfortable with.
6. Save and close the file.
7. Check the status of your branch.
$ git status
On branch dry-run-test
Untracked files:
(use "git add <file>..." to include in what will be committed)
TEST.md
nothing added to commit but untracked files present (use "git add" to track)
You've only changed the one file. It is untracked so far by git.
8. Add your file.
$ git add TEST.md
That is the only _staged_ file. Stage is fancy word for work that Git is
tracking.
9. Sign and commit your change.
$ git commit -s -m "Making a dry run test."
[dry-run-test 6e728fb] Making a dry run test
1 file changed, 1 insertion(+)
create mode 100644 TEST.md
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.
8. Push your changes to GitHub.
$ git push --set-upstream origin dry-run-test
Username for 'https://github.com': moxiegirl
Password for 'https://moxiegirl@github.com':
Git prompts you for your GitHub username and password. Then, the command
returns a result.
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 -> dry-run-test
Branch dry-run-test set up to track remote branch dry-run-test from origin.
9. Open your browser to GitHub.
10. Navigate to your Docker fork.
11. Make sure the `dry-run-test` branch exists, that it has your commit, and the
commit is signed.
![Branch Signature](images/branch-sig.png)
## Where to go next
Congratulations, you have finished configuring both your local host environment
and Git for contributing. In the next section you'll [learn how to set up and
work in a Docker development container](set-up-dev-env.md).

View file

@ -1,265 +0,0 @@
<!--[metadata]>
+++
title = "Set up for development on Windows"
description = "How to set up a server to test Docker Windows client"
keywords = ["development, inception, container, image Dockerfile, dependencies, Go, artifacts, windows"]
[menu.main]
parent = "smn_develop"
weight=3
+++
<![end-metadata]-->
# Get the required software for Windows
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:
- a GitHub account
- Git for Windows (msysGit)
- TDM-GCC, a compiler suite for Windows
- MinGW (tar and xz)
- Go language
> **Note**: This installation procedure refers to the `C:\` drive. If you system's main drive
is `D:\` you'll need to substitute that in where appropriate in these
instructions.
### Get a GitHub account
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.
You should also have some experience using both the GitHub application and `git`
on the command line.
## Install Git for Windows
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.
1. Browse to the [Git for Windows](https://msysgit.github.io/) download page.
2. Click **Download**.
Windows prompts you to save the file to your machine.
3. Run the saved file.
The system displays the **Git Setup** wizard.
4. Click the **Next** button to move through the wizard and accept all the defaults.
5. Click **Finish** when you are done.
## Installing TDM-GCC
TDM-GCC is a compiler suite for Windows. You'll use this suite to compile the
Docker Go code as you develop.
1. Browse to
[tdm-gcc download page](http://tdm-gcc.tdragon.net/download).
2. Click on the latest 64-bit version of the package.
Windows prompts you to save the file to your machine
3. Set up the suite by running the downloaded file.
The system opens the **TDM-GCC Setup** wizard.
4. Click **Create**.
5. Click the **Next** button to move through the wizard and accept all the defaults.
6. Click **Finish** when you are done.
## Installing MinGW (tar and xz)
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 `tar` and `xz` tools from the collection.
1. Browse to MinGW
[SourceForge](http://sourceforge.net/projects/mingw/).
2. Click **Download**.
Windows prompts you to save the file to your machine
3. Run the downloaded file.
The system opens the **MinGW Installation Manager Setup Tool**
4. Choose **Install** install the MinGW Installation Manager.
5. Press **Continue**.
The system installs and then opens the MinGW Installation Manager.
6. Press **Continue** after the install completes to open the manager.
7. Select **All Packages > MSYS Base System** from the left hand menu.
The system displays the available packages.
8. Click on the the **msys-tar bin** package and choose **Mark for Installation**.
9. Click on the **msys-xz bin** package and choose **Mark for Installation**.
10. Select **Installation > Apply Changes**, to install the selected packages.
The system displays the **Schedule of Pending Actions Dialog**.
![windows-mingw](images/windows-mingw.png)
11. Press **Apply**
MingGW installs the packages for you.
12. Close the dialog and the MinGW Installation Manager.
## Set up your environment variables
You'll need to add the compiler to your `Path` environment variable.
1. Open the **Control Panel**.
2. Choose **System and Security > System**.
3. Click the **Advanced system settings** link in the sidebar.
The system opens the **System Properties** dialog.
3. Select the **Advanced** tab.
4. Click **Environment Variables**.
The system opens the **Environment Variables dialog** dialog.
5. Locate the **System variables** area and scroll to the **Path**
variable.
![windows-mingw](images/path_variable.png)
6. Click **Edit** to edit the variable (you can also double-click it).
The system opens the **Edit System Variable** dialog.
7. Make sure the `Path` includes `C:\TDM-GCC64\bin`
![include gcc](images/include_gcc.png)
If you don't see `C:\TDM-GCC64\bin`, add it.
8. Press **OK** to close this dialog.
9. Press **OK** twice to close out of the remaining dialogs.
## Install Go and cross-compile it
In this section, you install the Go language. Then, you build the source so that it can cross-compile for `linux/amd64` architectures.
1. Open [Go Language download](http://golang.org/dl/) page in your browser.
2. Locate and click the latest `.msi` installer.
The system prompts you to save the file.
3. Run the installer.
The system opens the **Go Programming Language Setup** dialog.
4. Select all the defaults to install.
5. Press **Finish** to close the installation dialog.
6. Start a command prompt.
7. Change to the Go `src` directory.
cd c:\Go\src
8. Set the following Go variables
c:\Go\src> set GOOS=linux
c:\Go\src> set GOARCH=amd64
9. Compile the source.
c:\Go\src> make.bat
Compiling the source also adds a number of variables to your Windows environment.
## Get the Docker repository
In this step, you start a Git `bash` terminal and get the Docker source code
from GitHub.
1. Locate the **Git Bash** program and start it.
Recall that **Git Bash** came with the Git for Windows installation. **Git
Bash** just as it sounds allows you to run a Bash terminal on Windows.
![Git Bash](images/git_bash.png)
2. Change to the root directory.
$ cd /c/
3. Make a `gopath` directory.
$ mkdir gopath
4. Go get the `docker/docker` repository.
$ 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
In the next steps, you create environment variables for you Go paths.
5. Open the **Control Panel** on your system.
6. Choose **System and Security > System**.
7. Click the **Advanced system settings** link in the sidebar.
The system opens the **System Properties** dialog.
8. Select the **Advanced** tab.
9. Click **Environment Variables**.
The system opens the **Environment Variables dialog** dialog.
10. Locate the **System variables** area and scroll to the **Path**
variable.
11. Click **New**.
Now you are going to create some new variables. These paths you'll create in the next procedure; but you can set them now.
12. Enter `GOPATH` for the **Variable Name**.
13. For the **Variable Value** enter the following:
C:\gopath;C:\gopath\src\github.com\docker\docker\vendor
14. Press **OK** to close this dialog.
The system adds `GOPATH` to the list of **System Variables**.
15. Press **OK** twice to close out of the remaining dialogs.
## Where to go next
In the next section, you'll [learn how to set up and configure Git for
contributing to Docker](set-up-git.md).

View file

@ -1,98 +0,0 @@
<!--[metadata]>
+++
title = "Get the required software"
description = "Describes the software required to contribute to Docker"
keywords = ["GitHub account, repository, Docker, Git, Go, make, "]
[menu.main]
parent = "smn_develop"
weight=2
+++
<![end-metadata]-->
# Get the required software for Linux or OS X
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:
* a GitHub account
* `git`
* `make`
* `docker`
You'll notice that `go`, the language that Docker is written in, is not listed.
That's because you don't need it installed; Docker's development environment
provides it for you. You'll learn more about the development environment later.
### Get a GitHub account
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.
You should also have some experience using both the GitHub application and `git`
on the command line.
### Install git
Install `git` on your local system. You can check if `git` is on already on your
system and properly installed with the following command:
$ git --version
This documentation is written using `git` version 2.2.2. Your version may be
different depending on your OS.
### Install make
Install `make`. You can check if `make` is on your system with the following
command:
$ make -v
This documentation is written using GNU Make 3.81. Your version may be different
depending on your OS.
### Install or upgrade Docker
If you haven't already, install the Docker software using the
<a href="/engine/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.
To check if `docker` is already installed on Linux:
$ docker --version
Docker version 1.5.0, build a8a31ef
On Mac OS X or Windows, you should have installed Docker Toolbox which includes
Docker. You'll need to verify both Docker Machine and Docker. This
documentation was written on OS X using the following versions.
$ docker-machine --version
docker-machine version 0.3.0 (0a251fe)
$ docker --version
Docker version 1.7.0, build a8a31ef
## Linux users and sudo
This guide assumes you have added your user to the `docker` group on your system.
To check, list the group's contents:
$ getent group docker
docker:x:999:ubuntu
If the command returns no matches, you have two choices. You can preface this
guide's `docker` commands with `sudo` as you work. Alternatively, you can add
your user to the `docker` group as follows:
$ sudo usermod -aG docker ubuntu
You must log out and log back in for this modification to take effect.
## Where to go next
In the next section, you'll [learn how to set up and configure Git for
contributing to Docker](set-up-git.md).

View file

@ -1,331 +0,0 @@
<!--[metadata]>
+++
title = "Run tests and test documentation"
description = "Describes Docker's testing infrastructure"
keywords = ["make test, make docs, Go tests, gofmt, contributing, running tests"]
[menu.main]
parent = "smn_develop"
weight=6
+++
<![end-metadata]-->
# Run tests and test documentation
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's test infrastructure.
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.
In this section, you run tests in the `dry-run-test` branch of your Docker
fork. If you have followed along in this guide, you already have this branch.
If you don't have this branch, you can create it or simply use another of your
branches.
## Understand testing at Docker
Docker tests use the Go language's test framework. In this framework, files
whose names end in `_test.go` contain test code; you'll find test files like
this throughout the Docker repo. Use these files for inspiration when writing
your own tests. For information on Go's test framework, see <a
href="http://golang.org/pkg/testing/" target="_blank">Go's testing package
documentation</a> and the <a href="http://golang.org/cmd/go/#hdr-Test_packages"
target="_blank">go test help</a>.
You are responsible for _unit testing_ 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 ( _unit of work_ ) to verify the unit works as
expected.
Depending on your contribution, you may need to add _integration tests_. 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 `integration` and `integration-cli`
directories in the Docker repository contain integration test code.
Testing is its own specialty. If you aren'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.
### Run tests on your local host
Before submitting any code change, you should run the entire Docker test suite.
The `Makefile` contains a target for the entire test suite. The target's name
is simply `test`. The `Makefile` contains several targets for testing:
<style type="text/css">
.monospaced {font-family: Monaco, Consolas, "Lucida Console", 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>
</table>
Run the entire test suite on your current repository:
1. Open a terminal on your local host.
2. Change to the root your Docker repository.
$ cd docker-fork
3. Make sure you are in your development branch.
$ git checkout dry-run-test
4. Run the `make test` command.
$ make test
This command does several things, it creates a container temporarily for
testing. Inside that container, the `make`:
* creates a new binary
* cross-compiles all the binaries for the various operating systems
* runs all the tests in the system
It can take approximate one hour to run all the tests. The time depends
on your host performance. The default timeout is 60 minutes, which is
defined in hack/make.sh(${TIMEOUT:=60m}). You can modify the timeout
value on the basis of your host performance. When they complete
successfully, you see the output concludes with something like this:
PASS: docker_cli_pull_test.go:133: DockerHubPullSuite.TestPullClientDisconnect 1.127s
PASS: docker_cli_pull_test.go:16: DockerHubPullSuite.TestPullFromCentralRegistry 1.049s
PASS: docker_cli_pull_test.go:65: DockerHubPullSuite.TestPullFromCentralRegistryImplicitRefParts 9.795s
PASS: docker_cli_pull_test.go:42: DockerHubPullSuite.TestPullNonExistingImage 2.158s
PASS: docker_cli_pull_test.go:92: DockerHubPullSuite.TestPullScratchNotAllowed 0.044s
OK: 918 passed, 13 skipped
PASS
coverage: 72.9% of statements
ok github.com/docker/docker/integration-cli 1638.553s
---> Making bundle: .integration-daemon-stop (in bundles/1.9.0-dev/test-integration-cli)
++++ cat bundles/1.9.0-dev/test-integration-cli/docker.pid
+++ kill 9453
+++ /etc/init.d/apparmor stop
* Clearing AppArmor profiles cache
...done.
All profile caches have been cleared, but no profiles have been unloaded.
Unloading profiles will leave already running processes permanently
unconfined, which can lead to unexpected situations.
To set a process to complain mode, use the command line tool
'aa-complain'. To really tear down all profiles, run the init script
with the 'teardown' option."
---> Making bundle: test-docker-py (in bundles/1.9.0-dev/test-docker-py)
---> Making bundle: .integration-daemon-start (in bundles/1.9.0-dev/test-docker-py)
+++ /etc/init.d/apparmor start
* Starting AppArmor profiles
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
...done.
+++ exec docker daemon --debug --host unix:///go/src/github.com/docker/docker/bundles/1.9.0-dev/test-docker-py/docker.sock --storage-driver overlay --exec-driver native --pidfile bundles/1.9.0-dev/test-docker-py/docker.pid --userland-proxy=true
..............s..............s......................................
----------------------------------------------------------------------
Ran 68 tests in 79.135s
### Run test targets inside the development container
If you are working inside a Docker development container, you use the
`hack/make.sh` script to run tests. The `hack/make.sh` script doesn'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.
Try this now.
1. Open a terminal and change to the `docker-fork` root.
2. Start a Docker development image.
If you are following along with this guide, you should have a
`dry-run-test` image.
$ docker run --privileged --rm -ti -v `pwd`:/go/src/github.com/docker/docker dry-run-test /bin/bash
3. Run the tests using the `hack/make.sh` script.
root@5f8630b873fe:/go/src/github.com/docker/docker# hack/make.sh dynbinary binary cross test-unit test-integration-cli test-docker-py
The tests run just as they did within your local host.
Of course, you can also run a subset of these targets too. For example, to run
just the unit tests:
root@5f8630b873fe:/go/src/github.com/docker/docker# hack/make.sh dynbinary binary cross test-unit
Most test targets require that you build these precursor targets first:
`dynbinary binary cross`
## Running individual or multiple named tests
### Unit tests
We use golang standard [testing](https://golang.org/pkg/testing/)
package or [gocheck](https://labix.org/gocheck) for our unit tests.
You can use the `TESTDIRS` environment variable to run unit tests for
a single package.
$ TESTDIRS='opts' make test-unit
You can also use the `TESTFLAGS` environment variable to run a single test. The
flag's value is passed as arguments to the `go test` command. For example, from
your local host you can run the `TestBuild` test with this command:
$ TESTFLAGS='-test.run ^TestValidateIPAddress$' make test-unit
On unit tests, it's better to use `TESTFLAGS` in combination with
`TESTDIRS` to make it quicker to run a specific test.
$ TESTDIRS='opts' TESTFLAGS='-test.run ^TestValidateIPAddress$' make test-unit
### Integration tests
We use [gocheck](https://labix.org/gocheck) for our integration-cli tests.
You can use the `TESTFLAGS` environment variable to run a single test. The
flag's value is passed as arguments to the `go test` command. For example, from
your local host you can run the `TestBuild` test with this command:
$ TESTFLAGS='-check.f DockerSuite.TestBuild*' make test-integration-cli
To run the same test inside your Docker development container, you do this:
root@5f8630b873fe:/go/src/github.com/docker/docker# TESTFLAGS='-check.f TestBuild*' hack/make.sh binary test-integration-cli
## Testing the Windows binary against a Linux daemon
This explains how to test the Windows binary on a Windows machine set up as a
development environment. The tests will be run against a docker daemon
running on a remote Linux machine. You'll use **Git Bash** that came with the
Git for Windows installation. **Git Bash**, just as it sounds, allows you to
run a Bash terminal on Windows.
1. If you don't have one open already, start a Git Bash terminal.
![Git Bash](images/git_bash.png)
2. Change to the `docker` source directory.
$ cd /c/gopath/src/github.com/docker/docker
3. Set `DOCKER_REMOTE_DAEMON` as follows:
$ export DOCKER_REMOTE_DAEMON=1
4. Set `DOCKER_TEST_HOST` to the `tcp://IP_ADDRESS:2376` value; substitute your
Linux machines actual IP address. For example:
$ export DOCKER_TEST_HOST=tcp://213.124.23.200:2376
5. Make the binary and run the tests:
$ hack/make.sh binary test-integration-cli
Some tests are skipped on Windows for various reasons. You can see which
tests were skipped by re-running the make and passing in the
`TESTFLAGS='-test.v'` value. For example
$ TESTFLAGS='-test.v' hack/make.sh binary test-integration-cli
Should you wish to run a single test such as one with the name
'TestExample', you can pass in `TESTFLAGS='-check.f TestExample'`. For
example
$TESTFLAGS='-check.f TestExample' hack/make.sh binary test-integration-cli
You can now choose to make changes to the Docker source or the tests. If you
make any changes just run these commands again.
## Build and test the documentation
The Docker documentation source files are under `docs`. 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's
documentation. Of course, you don't need to install this generator
to build the documentation, it is included with container.
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>.
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.
1. In a terminal, change to the root of your `docker-fork` repository.
$ cd ~/repos/docker-fork
2. Make sure you are in your feature branch.
$ git status
On branch dry-run-test
Your branch is up-to-date with 'origin/dry-run-test'.
nothing to commit, working directory clean
3. Build the documentation.
$ make docs
When the build completes, you'll see a final output message similar to the
following:
Successfully built ee7fe7553123
docker run --rm -it -e AWS_S3_BUCKET -e NOCACHE -p 8000:8000 "docker-docs:dry-run-test" mkdocs serve
Running at: http://0.0.0.0:8000/
Live reload enabled.
Hold ctrl+c to quit.
4. Enter the URL in your browser.
If you are using Docker Machine, replace the default localhost address
(0.0.0.0) with your DOCKERHOST value. You can get this value at any time by
entering `docker-machine ip <machine-name>` at the command line.
5. Once in the documentation, look for the red notice to verify you are seeing the correct build.
![Beta documentation](images/red_notice.png)
6. Navigate to your new or changed document.
7. Review both the content and the links.
8. Return to your terminal and exit out of the running documentation container.
## Where to go next
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 [contribute to Docker by working on an
issue](make-a-contribution.md).

View file

@ -1,63 +0,0 @@
<!--[metadata]>
+++
title = "README first"
description = "Introduction to project contribution at Docker"
keywords = ["Gordon, introduction, turtle, machine, libcontainer, how to"]
[menu.main]
parent = "smn_develop"
+++
<![end-metadata]-->
# README first
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.
## Where and what you can contribute
The Docker project consists of not just one but several repositories on GitHub.
So, in addition to the `docker/docker` repository, there is the
`docker/compose` repo, the `docker/machine` repo, and several more.
Contribute to any of these and you contribute to the Docker project.
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.
If you are new to the open source community, to Docker, or to formal
programming, you should start out contributing to the `docker/docker`
repository. Why? Because this guide is written for that repository specifically.
Finally, code or documentation isn'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't have a lot written about this yet, so just email
<mailto:feedback@docker.com> if this type of contributing interests you.
## A turtle is involved
![Gordon](images/gordon.jpeg)
Enough said.
## How to use this guide
This is written for the distracted, the overworked, the sloppy reader with fair
`git` 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.
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.
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.
## How to get started
Start by [getting the software you need to contribute](software-required.md).

View file

@ -1,200 +0,0 @@
<!--[metadata]>
+++
title = "Work on your issue"
description = "Basic workflow for Docker contributions"
keywords = ["contribute, pull request, review, workflow, beginner, squash, commit"]
[menu.main]
parent = "smn_contribute"
weight=3
+++
<![end-metadata]-->
# Work on your issue
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.
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 --- you
could spend days or 30 minutes of your time.
## How to work on your local branch
Follow this workflow as you work:
1. Review the appropriate style guide.
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>.
2. Make changes in your feature branch.
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.
Make sure you don't change files in the `vendor` 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>.
3. Test your changes as you work.
If you have followed along with the guide, you know the `make test` target
runs the entire test suite and `make docs` 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>.
4. For code changes, add unit tests if appropriate.
If you add new functionality or change existing functionality, you should
add a unit test also. Use the existing test files for inspiration. Aren't
sure if you need tests? Skip this step; you can add them later in the
process if necessary.
5. Format your source files correctly.
<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>
6. List your changes.
$ git status
On branch 11038-fix-rhel-link
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: docs/installation/mac.md
modified: docs/installation/rhel.md
The `status` command lists what changed in the repository. Make sure you see
the changes you expect.
7. Add your change to Git.
$ git add docs/installation/mac.md
$ git add docs/installation/rhel.md
8. Commit your changes making sure you use the `-s` flag to sign your work.
$ git commit -s -m "Fixing RHEL link"
9. Push your change to your repository.
$ 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 -> 11038-fix-rhel-link
Branch 11038-fix-rhel-link set up to track remote branch 11038-fix-rhel-link from origin.
## Review your branch on GitHub
After you push a new branch, you should verify it on GitHub:
1. Open your browser to <a href="https://github.com" target="_blank">GitHub</a>.
2. Go to your Docker fork.
3. Select your branch from the dropdown.
![Find branch](images/locate_branch.png)
4. Use the "Compare" button to compare the differences between your branch and master.
Depending how long you've been working on your branch, your branch maybe
behind Docker's upstream repository.
5. Review the commits.
Make sure your branch only shows the work you've done.
## Pull and rebase frequently
You should pull and rebase frequently as you work.
1. Return to the terminal on your local machine and checkout your
feature branch in your local `docker-fork` repository.
2. Fetch any last minute changes from `docker/docker`.
$ git fetch upstream master
From github.com:docker/docker
* branch master -> FETCH_HEAD
3. Start an interactive rebase.
$ git rebase -i upstream/master
4. Rebase opens an editor with a list of commits.
pick 1a79f55 Tweak some of the other text for grammar
pick 53e4983 Fix a link
pick 3ce07bb Add a new line about RHEL
5. Replace the `pick` keyword with `squash` on all but the first commit.
pick 1a79f55 Tweak some of the other text for grammar
squash 53e4983 Fix a link
squash 3ce07bb Add a new line about RHEL
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.
6. Edit and save your commit message.
$ git commit -s
Make sure your message includes <a href="../set-up-git" target="_blank">your signature</a>.
7. Force push any changes to your fork on GitHub.
$ git push -f origin 11038-fix-rhel-link
## Where to go next
At this point, you should understand how to work on an issue. In the next
section, you [learn how to make a pull request](create-pr.md).