Browse code

First pass updating CONTRIBUTING

This largely removes references to Docker where possible.

The HOWTO guides are still Docker docs and refer to Docker not
moby, so the next step is to rework these as Moby docs and put
them in `docs/` in this repo.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>

Justin Cormack authored on 2017/10/11 23:06:02
Showing 14 changed files
... ...
@@ -1,8 +1,8 @@
1
-# Contributing to Docker
1
+# Contribute to the Moby Project
2 2
 
3
-Want to hack on Docker? Awesome!  We have a contributor's guide that explains
4
-[setting up a Docker development environment and the contribution
5
-process](https://docs.docker.com/opensource/project/who-written-for/). 
3
+Want to hack on the Moby Project? Awesome! We have a contributor's guide that explains
4
+[setting up a development environment and the contribution
5
+process](docs/contributing/). 
6 6
 
7 7
 [![Contributors guide](docs/static_files/contributors.png)](https://docs.docker.com/opensource/project/who-written-for/)
8 8
 
... ...
@@ -21,14 +21,14 @@ start participating.
21 21
 
22 22
 ## Reporting security issues
23 23
 
24
-The Docker maintainers take security seriously. If you discover a security
24
+The Moby maintainers take security seriously. If you discover a security
25 25
 issue, please bring it to their attention right away!
26 26
 
27 27
 Please **DO NOT** file a public issue, instead send your report privately to
28 28
 [security@docker.com](mailto:security@docker.com).
29 29
 
30 30
 Security reports are greatly appreciated and we will publicly thank you for it.
31
-We also like to send gifts&mdash;if you're into Docker schwag, make sure to let
31
+We also like to send gifts&mdash;if you're into schwag, make sure to let
32 32
 us know. We currently do not offer a paid security bounty program, but are not
33 33
 ruling it out in the future.
34 34
 
... ...
@@ -83,11 +83,7 @@ contributions, see [the advanced contribution
83 83
 section](https://docs.docker.com/opensource/workflow/advanced-contributing/) in
84 84
 the contributors guide.
85 85
 
86
-We try hard to keep Docker lean and focused. Docker can't do everything for
87
-everybody. This means that we might decide against incorporating a new feature.
88
-However, there might be a way to implement that feature *on top of* Docker.
89
-
90
-### Talking to other Docker users and contributors
86
+### Connect with other Moby Project contributors
91 87
 
92 88
 <table class="tg">
93 89
   <col width="45%">
... ...
@@ -96,52 +92,29 @@ However, there might be a way to implement that feature *on top of* Docker.
96 96
     <td>Forums</td>
97 97
     <td>
98 98
       A public forum for users to discuss questions and explore current design patterns and
99
-      best practices about Docker and related projects in the Docker Ecosystem. To participate,
100
-      just log in with your Docker Hub account on <a href="https://forums.docker.com" target="_blank">https://forums.docker.com</a>.
99
+      best practices about all the Moby projects. To participate, log in with your Github
100
+      account or create an account at <a href="https://forums.mobyproject.org" target="_blank">https://forums.mobyproject.org</a>.
101 101
     </td>
102 102
   </tr>
103 103
   <tr>
104
-    <td>Internet&nbsp;Relay&nbsp;Chat&nbsp;(IRC)</td>
104
+    <td>Slack</td>
105 105
     <td>
106 106
       <p>
107
-        IRC a direct line to our most knowledgeable Docker users; we have
108
-        both the  <code>#docker</code> and <code>#docker-dev</code> group on
109
-        <strong>irc.freenode.net</strong>.
110
-        IRC is a rich chat protocol but it can overwhelm new users. You can search
111
-        <a href="https://botbot.me/freenode/docker/#" target="_blank">our chat archives</a>.
112
-      </p>
113
-      <p>
114
-        Read our <a href="https://docs.docker.com/opensource/get-help/#irc-quickstart" target="_blank">IRC quickstart guide</a>
115
-        for an easy way to get started.
107
+        Register for the Docker Community Slack at
108
+	<a href="https://community.docker.com/registrations/groups/4316" target="_blank">https://community.docker.com/registrations/groups/4316</a>.
109
+        We use the #moby-project channel for general discussion, and there are seperate channels for other Moby projects such as #containerd.
110
+	Archives are available at <a href="https://dockercommunity.slackarchive.io/" target="_blank">https://dockercommunity.slackarchive.io/</a>.
116 111
       </p>
117 112
     </td>
118 113
   </tr>
119 114
   <tr>
120
-    <td>Google Group</td>
121
-    <td>
122
-      The <a href="https://groups.google.com/forum/#!forum/docker-dev" target="_blank">docker-dev</a>
123
-      group is for contributors and other people contributing to the Docker project.
124
-      You can join them without a google account by sending an email to 
125
-      <a href="mailto:docker-dev+subscribe@googlegroups.com">docker-dev+subscribe@googlegroups.com</a>.
126
-      After receiving the join-request message, you can simply reply to that to confirm the subscription.
127
-    </td>
128
-  </tr>
129
-  <tr>
130 115
     <td>Twitter</td>
131 116
     <td>
132
-      You can follow <a href="https://twitter.com/docker/" target="_blank">Docker's Twitter feed</a>
117
+      You can follow <a href="https://twitter.com/moby/" target="_blank">Moby Project Twitter feed</a>
133 118
       to get updates on our products. You can also tweet us questions or just
134 119
       share blogs or stories.
135 120
     </td>
136 121
   </tr>
137
-  <tr>
138
-    <td>Stack Overflow</td>
139
-    <td>
140
-      Stack Overflow has thousands of Docker questions listed. We regularly
141
-      monitor <a href="https://stackoverflow.com/search?tab=newest&q=docker" target="_blank">Docker questions</a>
142
-      and so do many other knowledgeable Docker users.
143
-    </td>
144
-  </tr>
145 122
 </table>
146 123
 
147 124
 
... ...
@@ -159,7 +132,7 @@ Submit tests for your changes. See [TESTING.md](./TESTING.md) for details.
159 159
 
160 160
 If your changes need integration tests, write them against the API. The `cli`
161 161
 integration tests are slowly either migrated to API tests or moved away as unit
162
-tests in `docker/cli` and end-to-end tests for docker.
162
+tests in `docker/cli` and end-to-end tests for Docker.
163 163
 
164 164
 Update the documentation when creating or modifying features. Test your
165 165
 documentation changes for clarity, concision, and correctness, as well as a
... ...
@@ -266,15 +239,11 @@ Please see the [Coding Style](#coding-style) for further guidelines.
266 266
 
267 267
 ### Merge approval
268 268
 
269
-Docker maintainers use LGTM (Looks Good To Me) in comments on the code review to
270
-indicate acceptance.
271
-
272
-A change requires LGTMs from an absolute majority of the maintainers of each
273
-component affected. For example, if a change affects `docs/` and `registry/`, it
274
-needs an absolute majority from the maintainers of `docs/` AND, separately, an
275
-absolute majority of the maintainers of `registry/`.
269
+Moby maintainers use LGTM (Looks Good To Me) in comments on the code review to
270
+indicate acceptance, or use the Github review approval feature.
276 271
 
277
-For more details, see the [MAINTAINERS](MAINTAINERS) page.
272
+For an explanation of the review and approval process see the
273
+[REVIEWING](project/REVIEWING.md) page.
278 274
 
279 275
 ### Sign your work
280 276
 
... ...
@@ -342,9 +311,9 @@ Don't forget: being a maintainer is a time investment. Make sure you
342 342
 will have time to make yourself available. You don't have to be a
343 343
 maintainer to make a difference on the project!
344 344
 
345
-## Docker community guidelines
345
+## Moby community guidelines
346 346
 
347
-We want to keep the Docker community awesome, growing and collaborative. We need
347
+We want to keep the Moby community awesome, growing and collaborative. We need
348 348
 your help to keep it that way. To help with this we've come up with some general
349 349
 guidelines for the community as a whole:
350 350
 
351 351
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+### Get set up for Moby development
1
+
2
+ * [README first](who-written-for.md)
3
+ * [Get the required software](software-required.md)
4
+ * [Set up for development on Windows](software-req-win.md)
5
+ * [Configure Git for contributing](set-up-git.md)
6
+ * [Work with a development container](set-up-dev-env.md)
7
+ * [Run tests and test documentation](test.md)
0 8
new file mode 100644
1 9
Binary files /dev/null and b/docs/contributing/images/branch-sig.png differ
2 10
new file mode 100644
3 11
Binary files /dev/null and b/docs/contributing/images/contributor-edit.png differ
4 12
new file mode 100644
5 13
Binary files /dev/null and b/docs/contributing/images/copy_url.png differ
6 14
new file mode 100644
7 15
Binary files /dev/null and b/docs/contributing/images/fork_docker.png differ
8 16
new file mode 100644
9 17
Binary files /dev/null and b/docs/contributing/images/git_bash.png differ
10 18
new file mode 100644
11 19
Binary files /dev/null and b/docs/contributing/images/list_example.png differ
12 20
new file mode 100644
... ...
@@ -0,0 +1,321 @@
0
+### Work with a development container
1
+
2
+In this section, you learn to develop like the Moby Engine core team.
3
+The `moby/moby` repository includes a `Dockerfile` at its root. This file defines
4
+Moby's development environment. The `Dockerfile` lists the environment's
5
+dependencies: system libraries and binaries, Go environment, Go dependencies,
6
+etc.
7
+
8
+Moby's development environment is itself, ultimately a Docker container.
9
+You use the `moby/moby` repository and its `Dockerfile` to create a Docker image,
10
+run a Docker container, and develop code in the container.
11
+
12
+If you followed the procedures that <a href="/opensource/project/set-up-git/" target="_blank">
13
+set up Git for contributing</a>, you should have a fork of the `moby/moby`
14
+repository. You also created a branch called `dry-run-test`. In this section,
15
+you continue working with your fork on this branch.
16
+
17
+##  Task 1. Remove images and containers
18
+
19
+Moby developers run the latest stable release of the Docker software. They clean their local hosts of
20
+unnecessary Docker artifacts such as stopped containers or unused images.
21
+Cleaning unnecessary artifacts isn't strictly necessary, but it is good
22
+practice, so it is included here.
23
+
24
+To remove unnecessary artifacts:
25
+
26
+1. Verify that you have no unnecessary containers running on your host.
27
+
28
+   ```none
29
+   $ docker ps -a
30
+   ```
31
+
32
+   You should see something similar to the following:
33
+
34
+   ```none
35
+   CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
36
+   ```
37
+
38
+   There are no running or stopped containers on this host. A fast way to
39
+   remove old containers is the following:
40
+
41
+   You can now use the `docker system prune` command to achieve this:
42
+
43
+   ```none
44
+   $ docker system prune -a
45
+   ```
46
+
47
+   Older versions of the Docker Engine should reference the command below:
48
+
49
+   ```none
50
+   $ docker rm $(docker ps -a -q)
51
+   ```
52
+
53
+   This command uses `docker ps` to list all containers (`-a` flag) by numeric
54
+   IDs (`-q` flag). Then, the `docker rm` command removes the resulting list.
55
+   If you have running but unused containers, stop and then remove them with
56
+   the `docker stop` and `docker rm` commands.
57
+
58
+2. Verify that your host has no dangling images.
59
+
60
+   ```none
61
+   $ docker images
62
+   ```
63
+
64
+   You should see something similar to the following:
65
+
66
+   ```none
67
+   REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
68
+   ```
69
+
70
+   This host has no images. You may have one or more _dangling_ images. A
71
+   dangling image is not used by a running container and is not an ancestor of
72
+   another image on your system. A fast way to remove dangling image is
73
+   the following:
74
+
75
+   ```none
76
+   $ docker rmi -f $(docker images -q -a -f dangling=true)
77
+   ```
78
+
79
+   This command uses `docker images` to list all images (`-a` flag) by numeric
80
+   IDs (`-q` flag) and filter them to find dangling images (`-f dangling=true`).
81
+   Then, the `docker rmi` command forcibly (`-f` flag) removes
82
+   the resulting list. If you get a "docker: "rmi" requires a minimum of 1 argument."
83
+   message, that means there were no dangling images. To remove just one image, use the
84
+   `docker rmi ID` command.
85
+
86
+## Task 2. Start a development container
87
+
88
+If you followed the last procedure, your host is clean of unnecessary images and
89
+containers. In this section, you build an image from the Engine development
90
+environment and run it in the container. Both steps are automated for you by the
91
+Makefile in the Engine code repository. The first time you build an image, it
92
+can take over 15 minutes to complete.
93
+
94
+1. Open a terminal.
95
+
96
+   For [Docker Toolbox](../../toolbox/overview.md) users, use `docker-machine status your_vm_name` to make sure your VM is running. You
97
+   may need to run `eval "$(docker-machine env your_vm_name)"` to initialize your
98
+   shell environment. If you use Docker for Mac or Docker for Windows, you do not need
99
+   to use Docker Machine.
100
+
101
+2. Change into the root of the `moby-fork` repository.
102
+
103
+   ```none
104
+   $ cd ~/repos/moby-fork
105
+   ```
106
+
107
+   If you are following along with this guide, you created a `dry-run-test`
108
+   branch when you <a href="/opensource/project/set-up-git/" target="_blank">
109
+   set up Git for contributing</a>.
110
+
111
+3. Ensure you are on your `dry-run-test` branch.
112
+
113
+   ```none
114
+   $ git checkout dry-run-test
115
+   ```
116
+
117
+   If you get a message that the branch doesn't exist, add the `-b` flag (`git checkout -b dry-run-test`) so the
118
+   command both creates the branch and checks it out.
119
+
120
+4. Use `make` to build a development environment image and run it in a container.
121
+
122
+   ```none
123
+   $ make BIND_DIR=. shell
124
+   ```
125
+
126
+   Using the instructions in the
127
+   `Dockerfile`, the build may need to download and / or configure source and other images. On first build this process may take between 5 - 15 minutes to create an image. The command returns informational messages as it runs.  A
128
+   successful build returns a final message and opens a Bash shell into the
129
+   container.
130
+
131
+   ```none
132
+   Successfully built 3d872560918e
133
+   docker run --rm -i --privileged -e BUILDFLAGS -e KEEPBUNDLE -e DOCKER_BUILD_GOGC -e DOCKER_BUILD_PKGS -e DOCKER_CLIENTONLY -e DOCKER_DEBUG -e DOCKER_EXPERIMENTAL -e DOCKER_GITCOMMIT -e DOCKER_GRAPHDRIVER=devicemapper -e DOCKER_INCREMENTAL_BINARY -e DOCKER_REMAP_ROOT -e DOCKER_STORAGE_OPTS -e DOCKER_USERLANDPROXY -e TESTDIRS -e TESTFLAGS -e TIMEOUT -v "home/ubuntu/repos/docker/bundles:/go/src/github.com/moby/moby/bundles" -t "docker-dev:dry-run-test" bash
134
+   root@f31fa223770f:/go/src/github.com/moby/moby#
135
+   ```
136
+
137
+   At this point, your prompt reflects the container's BASH shell.
138
+
139
+5. List the contents of the current directory (`/go/src/github.com/moby/moby`).
140
+
141
+   You should see the image's source from the  `/go/src/github.com/moby/moby`
142
+   directory.
143
+
144
+   ![List example](images/list_example.png)
145
+
146
+6. Make a `dockerd` binary.
147
+
148
+   ```none
149
+   root@a8b2885ab900:/go/src/github.com/moby/moby# hack/make.sh binary
150
+   Removing bundles/
151
+
152
+   ---> Making bundle: binary (in bundles/binary)
153
+   Building: bundles/binary-daemon/dockerd-17.06.0-dev
154
+   Created binary: bundles/binary-daemon/dockerd-17.06.0-dev
155
+   Copying nested executables into bundles/binary-daemon
156
+
157
+   ```
158
+
159
+7. Run `make install`, which copies the binary to the container's
160
+   `/usr/local/bin/` directory.
161
+
162
+   ```none
163
+   root@a8b2885ab900:/go/src/github.com/moby/moby# make install
164
+   ```
165
+
166
+8. Start the Engine daemon running in the background.
167
+
168
+   ```none
169
+   root@a8b2885ab900:/go/src/github.com/docker/docker# dockerd -D &
170
+   ...output snipped...
171
+   DEBU[0001] Registering POST, /networks/{id:.*}/connect
172
+   DEBU[0001] Registering POST, /networks/{id:.*}/disconnect
173
+   DEBU[0001] Registering DELETE, /networks/{id:.*}
174
+   INFO[0001] API listen on /var/run/docker.sock
175
+   DEBU[0003] containerd connection state change: READY
176
+   ```
177
+
178
+   The `-D` flag starts the daemon in debug mode. The `&` starts it as a
179
+   background process. You'll find these options useful when debugging code
180
+   development. You will need to hit `return` in order to get back to your shell prompt.
181
+
182
+   > **Note**: The following command automates the `build`,
183
+   > `install`, and `run` steps above. Once the command below completes, hit `ctrl-z` to suspend the process, then run `bg 1` and hit `enter` to resume the daemon process in the background and get back to your shell prompt.
184
+
185
+   ```none
186
+   hack/make.sh binary install-binary run
187
+   ```
188
+
189
+9. Inside your container, check your Docker version.
190
+
191
+   ```none
192
+   root@5f8630b873fe:/go/src/github.com/moby/moby# docker --version
193
+   Docker version 1.12.0-dev, build 6e728fb
194
+   ```
195
+
196
+   Inside the container you are running a development version. This is the version
197
+   on the current branch. It reflects the value of the `VERSION` file at the
198
+   root of your `docker-fork` repository.
199
+
200
+10. Run the `hello-world` image.
201
+
202
+    ```none
203
+    root@5f8630b873fe:/go/src/github.com/moby/moby# docker run hello-world
204
+    ```
205
+
206
+11. List the image you just downloaded.
207
+
208
+    ```none
209
+    root@5f8630b873fe:/go/src/github.com/moby/moby# docker images
210
+	REPOSITORY   TAG     IMAGE ID      CREATED        SIZE
211
+	hello-world  latest  c54a2cc56cbb  3 months ago   1.85 kB
212
+    ```
213
+
214
+12. Open another terminal on your local host.
215
+
216
+13. List the container running your development container.
217
+
218
+    ```none
219
+    ubuntu@ubuntu1404:~$ docker ps
220
+    CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS              PORTS               NAMES
221
+    a8b2885ab900        docker-dev:dry-run-test   "hack/dind bash"    43 minutes ago      Up 43 minutes                           hungry_payne
222
+    ```
223
+
224
+    Notice that the tag on the container is marked with the `dry-run-test` branch name.
225
+
226
+
227
+## Task 3. Make a code change
228
+
229
+At this point, you have experienced the "Moby inception" technique. That is,
230
+you have:
231
+
232
+* forked and cloned the Moby Engine code repository
233
+* created a feature branch for development
234
+* created and started an Engine development container from your branch
235
+* built a binary inside of your development container
236
+* launched a `docker` daemon using your newly compiled binary
237
+* called the `docker` client to run a `hello-world` container inside
238
+  your development container
239
+
240
+Running the `make BIND_DIR=. shell` command mounted your local Docker repository source into
241
+your Docker container.
242
+
243
+   > **Note**: Inspecting the `Dockerfile` shows a `COPY . /go/src/github.com/docker/docker` instruction, suggesting that dynamic code changes will _not_ be reflected in the container. However inspecting the `Makefile` shows that the current working directory _will_ be mounted via a `-v` volume mount.
244
+
245
+When you start to develop code though, you'll
246
+want to iterate code changes and builds inside the container. If you have
247
+followed this guide exactly, you have a bash shell running a development
248
+container.
249
+
250
+Try a simple code change and see it reflected in your container. For this
251
+example, you'll edit the help for the `attach` subcommand.
252
+
253
+1. If you don't have one, open a terminal in your local host.
254
+
255
+2. Make sure you are in your `moby-fork` repository.
256
+
257
+   ```none
258
+   $ pwd
259
+   /Users/mary/go/src/github.com/moxiegirl/moby-fork
260
+   ```
261
+
262
+   Your location should be different because, at least, your username is
263
+   different.
264
+
265
+3. Open the `cmd/dockerd/docker.go` file.
266
+
267
+4. Edit the command's help message.
268
+
269
+   For example, you can edit this line:
270
+
271
+   ```go
272
+   Short:         "A self-sufficient runtime for containers.",
273
+   ```
274
+
275
+   And change it to this:
276
+
277
+   ```go
278
+   Short:         "A self-sufficient and really fun runtime for containers.",
279
+   ```
280
+
281
+5. Save and close the `cmd/dockerd/docker.go` file.
282
+
283
+6. Go to your running docker development container shell.
284
+
285
+7. Rebuild the binary by using the command `hack/make.sh binary` in the docker development container shell.
286
+
287
+8. Stop Docker if it is running.
288
+
289
+9. Copy the binaries to **/usr/bin** by entering the following commands in the docker development container shell.
290
+
291
+   ```
292
+   hack/make.sh binary install-binary
293
+   ```
294
+
295
+10. To view your change, run the `dockerd --help` command in the docker development container shell.
296
+
297
+   ```bash
298
+   root@b0cb4f22715d:/go/src/github.com/moby/moby# dockerd --help
299
+
300
+   Usage:        dockerd COMMAND
301
+
302
+   A self-sufficient and really fun runtime for containers.
303
+
304
+   Options:
305
+   ...
306
+
307
+   ```
308
+
309
+You've just done the basic workflow for changing the Engine code base. You made
310
+your code changes in your feature branch. Then, you updated the binary in your
311
+development container and tried your change out. If you were making a bigger
312
+change, you might repeat or iterate through this flow several times.
313
+
314
+## Where to go next
315
+
316
+Congratulations, you have successfully achieved Docker inception. You've had a
317
+small experience of the development process. You've set up your development
318
+environment and verified almost all the essential processes you need to
319
+contribute. Of course, before you start contributing, [you'll need to learn one
320
+more piece of the development process, the test framework](test.md).
0 321
new file mode 100644
... ...
@@ -0,0 +1,280 @@
0
+### Configure Git for contributing
1
+
2
+Work through this page to configure Git and a repository you'll use throughout
3
+the Contributor Guide. The work you do further in the guide, depends on the work
4
+you do here.
5
+
6
+## Task 1. Fork and clone the Moby code
7
+
8
+Before contributing, you first fork the Moby code repository. A fork copies
9
+a repository at a particular point in time. GitHub tracks for you where a fork
10
+originates.
11
+
12
+As you make contributions, you change your fork's code. When you are ready,
13
+you make a pull request back to the original Docker repository. If you aren't
14
+familiar with this workflow, don't worry, this guide walks you through all the
15
+steps.
16
+
17
+To fork and clone Moby:
18
+
19
+1. Open a browser and log into GitHub with your account.
20
+
21
+2. Go to the <a href="https://github.com/moby/moby"
22
+target="_blank">moby/moby repository</a>.
23
+
24
+3. Click the "Fork" button in the upper right corner of the GitHub interface.
25
+
26
+    ![Branch Signature](images/fork_docker.png)
27
+
28
+    GitHub forks the repository to your GitHub account. The original
29
+    `moby/moby` repository becomes a new fork `YOUR_ACCOUNT/moby` under
30
+    your account.
31
+
32
+4. Copy your fork's clone URL from GitHub.
33
+
34
+    GitHub allows you to use HTTPS or SSH protocols for clones. You can use the
35
+    `git` command line or clients like Subversion to clone a repository.
36
+
37
+    ![Copy clone URL](images/copy_url.png)
38
+
39
+    This guide assume you are using the HTTPS protocol and the `git` command
40
+    line. If you are comfortable with SSH and some other tool, feel free to use
41
+    that instead. You'll need to convert what you see in the guide to what is
42
+    appropriate to your tool.
43
+
44
+5. Open a terminal window on your local host and change to your home directory.
45
+
46
+   ```bash
47
+   $ cd ~
48
+   ```
49
+
50
+    In Windows, you'll work in your Docker Quickstart Terminal window instead of
51
+    Powershell or a `cmd` window.
52
+
53
+6. Create a `repos` directory.
54
+
55
+   ```bash
56
+   $ mkdir repos
57
+   ```
58
+
59
+7. Change into your `repos` directory.
60
+
61
+   ```bash
62
+   $ cd repos
63
+   ```
64
+
65
+8. Clone the fork to your local host into a repository called `moby-fork`.
66
+
67
+   ```bash
68
+   $ git clone https://github.com/moxiegirl/moby.git moby-fork
69
+   ```
70
+
71
+    Naming your local repo `moby-fork` should help make these instructions
72
+    easier to follow; experienced coders don't typically change the name.
73
+
74
+9. Change directory into your new `moby-fork` directory.
75
+
76
+   ```bash
77
+   $ cd moby-fork
78
+   ```
79
+
80
+    Take a moment to familiarize yourself with the repository's contents. List
81
+    the contents.
82
+
83
+## Task 2. Set your signature and an upstream remote
84
+
85
+When you contribute to Docker, you must certify you agree with the
86
+<a href="http://developercertificate.org/" target="_blank">Developer Certificate of Origin</a>.
87
+You indicate your agreement by signing your `git` commits like this:
88
+
89
+```
90
+Signed-off-by: Pat Smith <pat.smith@email.com>
91
+```
92
+
93
+To create a signature, you configure your username and email address in Git.
94
+You can set these globally or locally on just your `moby-fork` repository.
95
+You must sign with your real name. You can sign your git commit automatically
96
+with `git commit -s`. Moby does not accept anonymous contributions or contributions
97
+through pseudonyms.
98
+
99
+As you change code in your fork, you'll want to keep it in sync with the changes
100
+others make in the `moby/moby` repository. To make syncing easier, you'll
101
+also add a _remote_ called `upstream` that points to `moby/moby`. A remote
102
+is just another project version hosted on the internet or network.
103
+
104
+To configure your username, email, and add a remote:
105
+
106
+1. Change to the root of your `moby-fork` repository.
107
+
108
+   ```bash
109
+   $ cd moby-fork
110
+   ```
111
+
112
+2. Set your `user.name` for the repository.
113
+
114
+   ```bash
115
+   $ git config --local user.name "FirstName LastName"
116
+   ```
117
+
118
+3. Set your `user.email` for the repository.
119
+
120
+   ```bash
121
+   $ git config --local user.email "emailname@mycompany.com"
122
+   ```
123
+
124
+4. Set your local repo to track changes upstream, on the `moby/moby` repository.
125
+
126
+   ```bash
127
+   $ git remote add upstream https://github.com/moby/moby.git
128
+   ```
129
+
130
+5. Check the result in your `git` configuration.
131
+
132
+   ```bash
133
+   $ git config --local -l
134
+   core.repositoryformatversion=0
135
+   core.filemode=true
136
+   core.bare=false
137
+   core.logallrefupdates=true
138
+   remote.origin.url=https://github.com/moxiegirl/moby.git
139
+   remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
140
+   branch.master.remote=origin
141
+   branch.master.merge=refs/heads/master
142
+   user.name=Mary Anthony
143
+   user.email=mary@docker.com
144
+   remote.upstream.url=https://github.com/moby/moby.git
145
+   remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/*
146
+   ```
147
+
148
+	To list just the remotes use:
149
+
150
+   ```bash
151
+   $ git remote -v
152
+   origin	https://github.com/moxiegirl/moby.git (fetch)
153
+   origin	https://github.com/moxiegirl/moby.git (push)
154
+   upstream https://github.com/moby/moby.git (fetch)
155
+   upstream https://github.com/moby/moby.git (push)
156
+   ```
157
+
158
+## Task 3. Create and push a branch
159
+
160
+As you change code in your fork, make your changes on a repository branch.
161
+The branch name should reflect what you are working on. In this section, you
162
+create a branch, make a change, and push it up to your fork.
163
+
164
+This branch is just for testing your config for this guide. The changes are part
165
+of a dry run, so the branch name will be dry-run-test. To create and push
166
+the branch to your fork on GitHub:
167
+
168
+1. Open a terminal and go to the root of your `moby-fork`.
169
+
170
+   ```bash
171
+   $ cd moby-fork
172
+   ```
173
+
174
+2. Create a `dry-run-test` branch.
175
+
176
+   ```bash
177
+   $ git checkout -b dry-run-test
178
+   ```
179
+
180
+    This command creates the branch and switches the repository to it.
181
+
182
+3. Verify you are in your new branch.
183
+
184
+   ```bash
185
+   $ git branch
186
+   * dry-run-test
187
+     master
188
+   ```
189
+
190
+    The current branch has an * (asterisk) marker. So, these results show you
191
+    are on the right branch.
192
+
193
+4. Create a `TEST.md` file in the repository's root.
194
+
195
+   ```bash
196
+   $ touch TEST.md
197
+   ```
198
+
199
+5. Edit the file and add your email and location.
200
+
201
+    ![Add your information](images/contributor-edit.png)
202
+
203
+    You can use any text editor you are comfortable with.
204
+
205
+6. Save and close the file.
206
+
207
+7. Check the status of your branch.
208
+
209
+   ```bash
210
+   $ git status
211
+   On branch dry-run-test
212
+   Untracked files:
213
+     (use "git add <file>..." to include in what will be committed)
214
+
215
+       TEST.md
216
+
217
+   nothing added to commit but untracked files present (use "git add" to track)
218
+   ```
219
+
220
+	You've only changed the one file. It is untracked so far by git.
221
+
222
+8. Add your file.
223
+
224
+   ```bash
225
+   $ git add TEST.md
226
+   ```
227
+
228
+    That is the only _staged_ file. Stage is fancy word for work that Git is
229
+    tracking.
230
+
231
+9. Sign and commit your change.
232
+
233
+   ```bash
234
+   $ git commit -s -m "Making a dry run test."
235
+   [dry-run-test 6e728fb] Making a dry run test
236
+    1 file changed, 1 insertion(+)
237
+    create mode 100644 TEST.md
238
+   ```
239
+
240
+    Commit messages should have a short summary sentence of no more than 50
241
+    characters. Optionally, you can also include a more detailed explanation
242
+    after the summary. Separate the summary from any explanation with an empty
243
+    line.
244
+
245
+10. Push your changes to GitHub.
246
+
247
+    ```bash
248
+    $ git push --set-upstream origin dry-run-test
249
+    Username for 'https://github.com': moxiegirl
250
+    Password for 'https://moxiegirl@github.com':
251
+    ```
252
+
253
+    Git prompts you for your GitHub username and password. Then, the command
254
+    returns a result.
255
+
256
+    ```bash
257
+    Counting objects: 13, done.
258
+    Compressing objects: 100% (2/2), done.
259
+    Writing objects: 100% (3/3), 320 bytes | 0 bytes/s, done.
260
+    Total 3 (delta 1), reused 0 (delta 0)
261
+    To https://github.com/moxiegirl/moby.git
262
+     * [new branch]      dry-run-test -> dry-run-test
263
+    Branch dry-run-test set up to track remote branch dry-run-test from origin.
264
+    ```
265
+
266
+11. Open your browser to GitHub.
267
+
268
+12. Navigate to your Moby fork.
269
+
270
+13. Make sure the `dry-run-test` branch exists, that it has your commit, and the
271
+commit is signed.
272
+
273
+    ![Branch Signature](images/branch-sig.png)
274
+
275
+## Where to go next
276
+
277
+Congratulations, you have finished configuring both your local host environment
278
+and Git for contributing. In the next section you'll [learn how to set up and
279
+work in a Moby development container](set-up-dev-env.md).
0 280
new file mode 100644
... ...
@@ -0,0 +1,177 @@
0
+### Build and test Moby on Windows
1
+
2
+This page explains how to get the software you need to build, test, and run the
3
+Moby source code for Windows and setup the required software and services:
4
+
5
+- Windows containers
6
+- GitHub account
7
+- Git
8
+
9
+## Prerequisites
10
+
11
+### 1. Windows Server 2016 or Windows 10 with all Windows updates applied
12
+
13
+The major build number must be at least 14393. This can be confirmed, for example,
14
+by running the following from an elevated PowerShell prompt - this sample output
15
+is from a fully up to date machine as at mid-November 2016:
16
+
17
+
18
+    PS C:\> $(gin).WindowsBuildLabEx
19
+    14393.447.amd64fre.rs1_release_inmarket.161102-0100
20
+
21
+### 2. Git for Windows (or another git client) must be installed
22
+
23
+https://git-scm.com/download/win.
24
+
25
+### 3. The machine must be configured to run containers
26
+
27
+For example, by following the quick start guidance at
28
+https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start or https://github.com/docker/labs/blob/master/windows/windows-containers/Setup.md
29
+
30
+### 4. If building in a Hyper-V VM
31
+
32
+For Windows Server 2016 using Windows Server containers as the default option,
33
+it is recommended you have at least 1GB of memory assigned;
34
+For Windows 10 where Hyper-V Containers are employed, you should have at least
35
+4GB of memory assigned.
36
+Note also, to run Hyper-V containers in a VM, it is necessary to configure the VM
37
+for nested virtualization.
38
+
39
+## Usage
40
+
41
+The following steps should be run from an elevated Windows PowerShell prompt.
42
+
43
+>**Note**:  In a default installation of containers on Windows following the quick-start guidance at https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start,
44
+the `docker.exe` client must run elevated to be able to connect to the daemon).
45
+
46
+### 1. Windows containers
47
+
48
+To test and run the Windows Moby engine, you need a system that supports Windows Containers:
49
+
50
+- Windows 10 Anniversary Edition
51
+- Windows Server 2016 running in a VM, on bare metal or in the cloud
52
+
53
+Check out the [getting started documentation](https://github.com/docker/labs/blob/master/windows/windows-containers/Setup.md) for details.
54
+
55
+### 2. GitHub account
56
+
57
+To contribute to the Docker project, you need a <a href="https://github.com" target="_blank">GitHub account</a>.
58
+A free account is fine. All the Moby project repositories are public and visible to everyone.
59
+
60
+This guide assumes that you have basic familiarity with Git and Github terminology
61
+and usage.
62
+Refer to [GitHub For Beginners: Don’t Get Scared, Get Started](http://readwrite.com/2013/09/30/understanding-github-a-journey-for-beginners-part-1/)
63
+to get up to speed on Github.
64
+
65
+### 3. Git
66
+
67
+In PowerShell, run:
68
+
69
+    Invoke-Webrequest "https://github.com/git-for-windows/git/releases/download/v2.7.2.windows.1/Git-2.7.2-64-bit.exe" -OutFile git.exe -UseBasicParsing
70
+    Start-Process git.exe -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS /DIR=c:\git\' -Wait
71
+    setx /M PATH "$env:Path;c:\git\cmd"
72
+
73
+You are now ready clone and build the Moby source code.
74
+
75
+### 4. Clone Moby
76
+
77
+In a new (to pick up the path change) PowerShell prompt, run:
78
+
79
+    git clone https://github.com/moby/moby
80
+    cd moby
81
+
82
+This clones the main Moby repository. Check out [Moby Project](https://mobyproject.org)
83
+to learn about the other software that powers the Moby platform.
84
+
85
+### 5. Build and run
86
+
87
+Create a builder-container with the Moby source code. You can change the source
88
+code on your system and rebuild any time:
89
+
90
+    docker build -t nativebuildimage -f .\Dockerfile.windows .
91
+    docker build -t nativebuildimage -f Dockerfile.windows -m 2GB .  # (if using Hyper-V containers)
92
+
93
+To build Moby, run:
94
+
95
+    $DOCKER_GITCOMMIT=(git rev-parse --short HEAD)
96
+    docker run --name binaries -e DOCKER_GITCOMMIT=$DOCKER_GITCOMMIT nativebuildimage hack\make.ps1 -Binary
97
+    docker run --name binaries -e DOCKER_GITCOMMIT=$DOCKER_GITCOMMIT -m 2GB nativebuildimage hack\make.ps1 -Binary  # (if using Hyper-V containers)
98
+
99
+Copy out the resulting Windows Moby Engine binary to `dockerd.exe` in the
100
+current directory:
101
+
102
+    docker cp binaries:C:\go\src\github.com\moby\moby\bundles\docker.exe docker.exe
103
+    docker cp binaries:C:\go\src\github.com\moby\moby\bundles\dockerd.exe dockerd.exe
104
+
105
+To test it, stop the system Docker daemon and start the one you just built:
106
+
107
+    Stop-Service Docker
108
+    .\dockerd.exe -D
109
+
110
+The other make targets work too, to run unit tests try:
111
+`docker run --rm docker-builder sh -c 'cd /c/go/src/github.com/moby/moby; hack/make.sh test-unit'`.
112
+
113
+### 6. Remove the interim binaries container
114
+
115
+_(Optional)_
116
+
117
+    docker rm binaries
118
+
119
+### 7. Remove the image
120
+
121
+_(Optional)_
122
+
123
+It may be useful to keep this image around if you need to build multiple times.
124
+Then you can take advantage of the builder cache to have an image which has all
125
+the components required to build the binaries already installed.
126
+
127
+    docker rmi nativebuildimage
128
+
129
+## Validation
130
+
131
+The validation tests can only run directly on the host.
132
+This is because they calculate information from the git repo, but the .git directory
133
+is not passed into the image as it is excluded via `.dockerignore`.
134
+Run the following from a Windows PowerShell prompt (elevation is not required):
135
+(Note Go must be installed to run these tests)
136
+
137
+    hack\make.ps1 -DCO -PkgImports -GoFormat
138
+
139
+## Unit tests
140
+
141
+To run unit tests, ensure you have created the nativebuildimage above.
142
+Then run one of the following from an (elevated) Windows PowerShell prompt:
143
+
144
+    docker run --rm nativebuildimage hack\make.ps1 -TestUnit
145
+    docker run --rm -m 2GB nativebuildimage hack\make.ps1 -TestUnit  # (if using Hyper-V containers)
146
+
147
+To run unit tests and binary build, ensure you have created the nativebuildimage above.
148
+Then run one of the following from an (elevated) Windows PowerShell prompt:
149
+
150
+    docker run nativebuildimage hack\make.ps1 -All
151
+    docker run -m 2GB nativebuildimage hack\make.ps1 -All  # (if using Hyper-V containers)
152
+
153
+## Windows limitations
154
+
155
+Don't attempt to use a bind mount to pass a local directory as the bundles
156
+target directory.
157
+It does not work (golang attempts for follow a mapped folder incorrectly).
158
+Instead, use docker cp as per the example.
159
+
160
+`go.zip` is not removed from the image as it is used by the Windows CI servers
161
+to ensure the host and image are running consistent versions of go.
162
+
163
+Nanoserver support is a work in progress. Although the image will build if the
164
+`FROM` statement is updated, it will not work when running autogen through `hack\make.ps1`.
165
+It is suspected that the required GCC utilities (eg gcc, windres, windmc) silently
166
+quit due to the use of console hooks which are not available.
167
+
168
+The docker integration tests do not currently run in a container on Windows,
169
+predominantly due to Windows not supporting privileged mode, so anything using a volume would fail.
170
+They (along with the rest of the docker CI suite) can be run using
171
+https://github.com/jhowardmsft/docker-w2wCIScripts/blob/master/runCI/Invoke-DockerCI.ps1.
172
+
173
+## Where to go next
174
+
175
+In the next section, you'll [learn how to set up and configure Git for
176
+contributing to Moby](set-up-git.md).
0 177
new file mode 100644
... ...
@@ -0,0 +1,94 @@
0
+### Get the required software for Linux or macOS
1
+
2
+This page explains how to get the software you need to use a Linux or macOS
3
+machine for Moby development. Before you begin contributing you must have:
4
+
5
+*  a GitHub account
6
+* `git`
7
+* `make`
8
+* `docker`
9
+
10
+You'll notice that `go`, the language that Moby is written in, is not listed.
11
+That's because you don't need it installed; Moby's development environment
12
+provides it for you. You'll learn more about the development environment later.
13
+
14
+## Task 1. Get a GitHub account
15
+
16
+To contribute to the Moby project, you will need a <a
17
+href="https://github.com" target="_blank">GitHub account</a>. A free account is
18
+fine. All the Moby project repositories are public and visible to everyone.
19
+
20
+You should also have some experience using both the GitHub application and `git`
21
+on the command line.
22
+
23
+## Task 2. Install git
24
+
25
+Install `git` on your local system. You can check if `git` is on already on your
26
+system and properly installed with the following command:
27
+
28
+```bash
29
+$ git --version
30
+```
31
+
32
+This documentation is written using `git` version 2.2.2. Your version may be
33
+different depending on your OS.
34
+
35
+## Task 3. Install make
36
+
37
+Install `make`. You can check if `make` is on your system with the following
38
+command:
39
+
40
+```bash
41
+$ make -v
42
+```
43
+
44
+This documentation is written using GNU Make 3.81. Your version may be different
45
+depending on your OS.
46
+
47
+## Task 4. Install or upgrade Docker
48
+
49
+If you haven't already, install the Docker software using the
50
+<a href="https://docs.docker.com/engine/installation/" target="_blank">instructions for your operating system</a>.
51
+If you have an existing installation, check your version and make sure you have
52
+the latest Docker.
53
+
54
+To check if `docker` is already installed on Linux:
55
+
56
+```bash
57
+docker --version
58
+Docker version 17.10.0-ce, build f4ffd25
59
+```
60
+
61
+On macOS or Windows, you should have installed Docker for Mac or
62
+Docker for Windows.
63
+
64
+```bash
65
+$ docker --version
66
+Docker version 17.10.0-ce, build f4ffd25
67
+```
68
+
69
+## Tip for Linux users
70
+
71
+This guide assumes you have added your user to the `docker` group on your system.
72
+To check, list the group's contents:
73
+
74
+```
75
+$ getent group docker
76
+docker:x:999:ubuntu
77
+```
78
+
79
+If the command returns no matches, you have two choices. You can preface this
80
+guide's `docker` commands with `sudo` as you work. Alternatively, you can add
81
+your user to the `docker` group as follows:
82
+
83
+```bash
84
+$ sudo usermod -aG docker ubuntu
85
+```
86
+
87
+You must log out and log back in for this modification to take effect.
88
+
89
+
90
+## Where to go next
91
+
92
+In the next section, you'll [learn how to set up and configure Git for
93
+contributing to Moby](set-up-git.md).
0 94
new file mode 100644
... ...
@@ -0,0 +1,234 @@
0
+### Run tests
1
+
2
+Contributing includes testing your changes. If you change the Moby code, you
3
+may need to add a new test or modify an existing test. Your contribution could
4
+even be adding tests to Moby. For this reason, you need to know a little
5
+about Moby's test infrastructure.
6
+
7
+This section describes tests you can run in the `dry-run-test` branch of your Docker
8
+fork. If you have followed along in this guide, you already have this branch.
9
+If you don't have this branch, you can create it or simply use another of your
10
+branches.
11
+
12
+## Understand how to test Moby
13
+
14
+Moby tests use the Go language's test framework. In this framework, files
15
+whose names end in `_test.go` contain test code; you'll find test files like
16
+this throughout the Moby repo. Use these files for inspiration when writing
17
+your own tests. For information on Go's test framework, see <a
18
+href="http://golang.org/pkg/testing/" target="_blank">Go's testing package
19
+documentation</a> and the <a href="http://golang.org/cmd/go/#hdr-Test_packages"
20
+target="_blank">go test help</a>.
21
+
22
+You are responsible for _unit testing_ your contribution when you add new or
23
+change existing Moby code. A unit test is a piece of code that invokes a
24
+single, small piece of code (_unit of work_) to verify the unit works as
25
+expected.
26
+
27
+Depending on your contribution, you may need to add _integration tests_. These
28
+are tests that combine two or more work units into one component. These work
29
+units each have unit tests and then, together, integration tests that test the
30
+interface between the components. The `integration` and `integration-cli`
31
+directories in the Docker repository contain integration test code.
32
+
33
+Testing is its own specialty. If you aren't familiar with testing techniques,
34
+there is a lot of information available to you on the Web. For now, you should
35
+understand that, the Docker maintainers may ask you to write a new test or
36
+change an existing one.
37
+
38
+## Run tests on your local host
39
+
40
+Before submitting a pull request with a code change, you should run the entire
41
+Moby Engine test suite. The `Makefile` contains a target for the entire test
42
+suite, named `test`. Also, it contains several targets for
43
+testing:
44
+
45
+| Target                 | What this target does                          |
46
+| ---------------------- | ---------------------------------------------- |
47
+| `test`                 | Run the unit, integration, and docker-py tests |
48
+| `test-unit`            | Run just the unit tests                        |
49
+| `test-integration-cli` | Run the integration tests for the CLI          |
50
+| `test-docker-py`       | Run the tests for the Docker API client        |
51
+
52
+Running the entire test suite on your current repository can take over half an
53
+hour. To run the test suite, do the following:
54
+
55
+1.  Open a terminal on your local host.
56
+
57
+2.  Change to the root of your Docker repository.
58
+
59
+    ```bash
60
+    $ cd moby-fork
61
+    ```
62
+
63
+3.  Make sure you are in your development branch.
64
+
65
+    ```bash
66
+    $ git checkout dry-run-test
67
+    ```
68
+
69
+4.  Run the `make test` command.
70
+
71
+    ```bash
72
+    $ make test
73
+    ```
74
+
75
+    This command does several things, it creates a container temporarily for
76
+    testing. Inside that container, the `make`:
77
+
78
+    * creates a new binary
79
+    * cross-compiles all the binaries for the various operating systems
80
+    * runs all the tests in the system
81
+
82
+    It can take approximate one hour to run all the tests. The time depends
83
+    on your host performance. The default timeout is 60 minutes, which is
84
+    defined in `hack/make.sh` (`${TIMEOUT:=60m}`). You can modify the timeout
85
+    value on the basis of your host performance. When they complete
86
+    successfully, you see the output concludes with something like this:
87
+
88
+    ```none
89
+    Ran 68 tests in 79.135s
90
+    ```
91
+
92
+## Run targets inside a development container
93
+
94
+If you are working inside a development container, you use the
95
+`hack/make.sh` script to run tests. The `hack/make.sh` script doesn't
96
+have a single target that runs all the tests. Instead, you provide a single
97
+command line with multiple targets that does the same thing.
98
+
99
+Try this now.
100
+
101
+1.  Open a terminal and change to the `moby-fork` root.
102
+
103
+2.  Start a Moby development image.
104
+
105
+    If you are following along with this guide, you should have a
106
+    `dry-run-test` image.
107
+
108
+    ```bash
109
+    $ docker run --privileged --rm -ti -v `pwd`:/go/src/github.com/moby/moby dry-run-test /bin/bash
110
+    ```
111
+
112
+3.  Run the tests using the `hack/make.sh` script.
113
+
114
+    ```bash
115
+    root@5f8630b873fe:/go/src/github.com/moby/moby# hack/make.sh dynbinary binary cross test-unit test-integration-cli test-docker-py
116
+    ```
117
+
118
+    The tests run just as they did within your local host.
119
+
120
+    Of course, you can also run a subset of these targets too. For example, to run
121
+    just the unit tests:
122
+
123
+    ```bash
124
+    root@5f8630b873fe:/go/src/github.com/moby/moby# hack/make.sh dynbinary binary cross test-unit
125
+    ```
126
+
127
+    Most test targets require that you build these precursor targets first:
128
+    `dynbinary binary cross`
129
+
130
+
131
+## Run unit tests
132
+
133
+We use golang standard [testing](https://golang.org/pkg/testing/)
134
+package or [gocheck](https://labix.org/gocheck) for our unit tests.
135
+
136
+You can use the `TESTDIRS` environment variable to run unit tests for
137
+a single package.
138
+
139
+```bash
140
+$ TESTDIRS='opts' make test-unit
141
+```
142
+
143
+You can also use the `TESTFLAGS` environment variable to run a single test. The
144
+flag's value is passed as arguments to the `go test` command. For example, from
145
+your local host you can run the `TestBuild` test with this command:
146
+
147
+```bash
148
+$ TESTFLAGS='-test.run ^TestValidateIPAddress$' make test-unit
149
+```
150
+
151
+On unit tests, it's better to use `TESTFLAGS` in combination with
152
+`TESTDIRS` to make it quicker to run a specific test.
153
+
154
+```bash
155
+$ TESTDIRS='opts' TESTFLAGS='-test.run ^TestValidateIPAddress$' make test-unit
156
+```
157
+
158
+## Run integration tests
159
+
160
+We use [gocheck](https://labix.org/gocheck) for our integration-cli tests.
161
+You can use the `TESTFLAGS` environment variable to run a single test. The
162
+flag's value is passed as arguments to the `go test` command. For example, from
163
+your local host you can run the `TestBuild` test with this command:
164
+
165
+```bash
166
+$ TESTFLAGS='-check.f DockerSuite.TestBuild*' make test-integration-cli
167
+```
168
+
169
+To run the same test inside your Docker development container, you do this:
170
+
171
+```bash
172
+root@5f8630b873fe:/go/src/github.com/moby/moby# TESTFLAGS='-check.f TestBuild*' hack/make.sh binary test-integration-cli
173
+```
174
+
175
+## Test the Windows binary against a Linux daemon
176
+
177
+This explains how to test the Windows binary on a Windows machine set up as a
178
+development environment. The tests will be run against a daemon
179
+running on a remote Linux machine. You'll use **Git Bash** that came with the
180
+Git for Windows installation. **Git Bash**, just as it sounds, allows you to
181
+run a Bash terminal on Windows.
182
+
183
+1.  If you don't have one open already, start a Git Bash terminal.
184
+
185
+    ![Git Bash](images/git_bash.png)
186
+
187
+2.  Change to the `moby` source directory.
188
+
189
+    ```bash
190
+    $ cd /c/gopath/src/github.com/moby/moby
191
+    ```
192
+
193
+3.  Set `DOCKER_REMOTE_DAEMON` as follows:
194
+
195
+    ```bash
196
+    $ export DOCKER_REMOTE_DAEMON=1
197
+    ```
198
+
199
+4.  Set `DOCKER_TEST_HOST` to the `tcp://IP_ADDRESS:2376` value; substitute your
200
+    Linux machines actual IP address. For example:
201
+
202
+    ```bash
203
+    $ export DOCKER_TEST_HOST=tcp://213.124.23.200:2376
204
+    ```
205
+
206
+5.  Make the binary and run the tests:
207
+
208
+    ```bash
209
+    $ hack/make.sh binary test-integration-cli
210
+    ```
211
+    Some tests are skipped on Windows for various reasons. You can see which
212
+    tests were skipped by re-running the make and passing in the
213
+   `TESTFLAGS='-test.v'` value. For example
214
+
215
+    ```bash
216
+    $ TESTFLAGS='-test.v' hack/make.sh binary test-integration-cli
217
+    ```
218
+
219
+    Should you wish to run a single test such as one with the name
220
+    'TestExample', you can pass in `TESTFLAGS='-check.f TestExample'`. For
221
+    example
222
+
223
+    ```bash
224
+    $ TESTFLAGS='-check.f TestExample' hack/make.sh binary test-integration-cli
225
+    ```
226
+
227
+You can now choose to make changes to the Moby source or the tests. If you
228
+make any changes, just run these commands again.
229
+
230
+## Where to go next
231
+
232
+Congratulations, you have successfully completed the basics you need to
233
+understand the Moby test framework.
0 234
new file mode 100644
... ...
@@ -0,0 +1,49 @@
0
+### README first
1
+
2
+This section of the documentation contains a guide for Moby project users who want to
3
+contribute code or documentation to the Moby Engine project. As a community, we
4
+share rules of behavior and interaction. Make sure you are familiar with the <a
5
+href="https://github.com/moby/moby/blob/master/CONTRIBUTING.md#docker-community-guidelines"
6
+target="_blank">community guidelines</a> before continuing.
7
+
8
+## Where and what you can contribute
9
+
10
+The Moby project consists of not just one but several repositories on GitHub.
11
+So, in addition to the `moby/moby` repository, there is the
12
+`containerd/containerd` repo, the `moby/buildkit` repo, and several more.
13
+Contribute to any of these and you contribute to the Moby project.
14
+
15
+Not all Moby repositories use the Go language. Also, each repository has its
16
+own focus area. So, if you are an experienced contributor, think about
17
+contributing to a Moby project repository that has a language or a focus area you are
18
+familiar with.
19
+
20
+If you are new to the open source community, to Moby, or to formal
21
+programming, you should start out contributing to the `moby/moby`
22
+repository. Why? Because this guide is written for that repository specifically.
23
+
24
+Finally, code or documentation isn't the only way to contribute. You can report
25
+an issue, add to discussions in our community channel, write a blog post, or
26
+take a usability test. You can even propose your own type of contribution.
27
+Right now we don't have a lot written about this yet, but feel free to open an issue
28
+to discuss other contributions.
29
+
30
+## How to use this guide
31
+
32
+This is written for the distracted, the overworked, the sloppy reader with fair
33
+`git` skills and a failing memory for the GitHub GUI. The guide attempts to
34
+explain how to use the Moby Engine development environment as precisely,
35
+predictably, and procedurally as possible.
36
+
37
+Users who are new to Engine development should start by setting up their
38
+environment. Then, they should try a simple code change. After that, you should
39
+find something to work on or propose a totally new change.
40
+
41
+If you are a programming prodigy, you still may find this documentation useful.
42
+Please feel free to skim past information you find obvious or boring.
43
+
44
+## How to get started
45
+
46
+Start by getting the software you require. If you are on Mac or Linux, go to
47
+[get the required software for Linux or macOS](software-required.md). If you are
48
+on Windows, see [get the required software for Windows](software-req-win.md).