2014-05-04 20:38:44 -04:00
|
|
|
# Docker Documentation
|
2013-03-25 23:48:04 -04:00
|
|
|
|
2014-05-13 20:22:55 -04:00
|
|
|
The source for Docker documentation is here under `sources/` and uses extended
|
2014-05-14 14:12:42 -04:00
|
|
|
Markdown, as implemented by [MkDocs](http://mkdocs.org).
|
2014-04-15 02:01:25 -04:00
|
|
|
|
2014-07-01 20:30:25 -04:00
|
|
|
The HTML files are built and hosted on `https://docs.docker.com`, and update
|
2014-05-13 20:22:55 -04:00
|
|
|
automatically after each change to the master or release branch of [Docker on
|
2014-07-24 18:19:50 -04:00
|
|
|
GitHub](https://github.com/docker/docker) thanks to post-commit hooks. The
|
2014-05-14 14:12:42 -04:00
|
|
|
`docs` branch maps to the "latest" documentation and the `master` (unreleased
|
2014-05-13 20:22:55 -04:00
|
|
|
development) branch maps to the "master" documentation.
|
2013-10-15 18:52:21 -04:00
|
|
|
|
2014-05-04 20:38:44 -04:00
|
|
|
## Contributing
|
|
|
|
|
2014-11-25 10:38:16 -05:00
|
|
|
Be sure to follow the [contribution guidelines](../CONTRIBUTING.md).
|
2014-10-29 19:43:18 -04:00
|
|
|
In particular, [remember to sign your work!](../CONTRIBUTING.md#sign-your-work)
|
2014-05-04 20:38:44 -04:00
|
|
|
|
|
|
|
## Getting Started
|
2013-10-15 18:52:21 -04:00
|
|
|
|
2014-05-13 20:22:55 -04:00
|
|
|
Docker documentation builds are done in a Docker container, which installs all
|
|
|
|
the required tools, adds the local `docs/` directory and builds the HTML docs.
|
|
|
|
It then starts a HTTP server on port 8000 so that you can connect and see your
|
|
|
|
changes.
|
2013-10-15 18:52:21 -04:00
|
|
|
|
2014-04-26 09:53:17 -04:00
|
|
|
In the root of the `docker` source directory:
|
2014-04-26 08:10:19 -04:00
|
|
|
|
2014-10-07 21:44:01 -04:00
|
|
|
$ make docs
|
|
|
|
.... (lots of output) ....
|
|
|
|
$ docker run --rm -it -e AWS_S3_BUCKET -p 8000:8000 "docker-docs:master" mkdocs serve
|
|
|
|
Running at: http://0.0.0.0:8000/
|
|
|
|
Live reload enabled.
|
|
|
|
Hold ctrl+c to quit.
|
2013-12-05 21:52:32 -05:00
|
|
|
|
2014-05-13 20:22:55 -04:00
|
|
|
If you have any issues you need to debug, you can use `make docs-shell` and then
|
|
|
|
run `mkdocs serve`
|
|
|
|
|
2014-10-07 21:44:01 -04:00
|
|
|
## Adding a new document
|
|
|
|
|
|
|
|
New document (`.md`) files are added to the documentation builds by adding them
|
|
|
|
to the menu definition in the `docs/mkdocs.yml` file.
|
|
|
|
|
2014-05-13 20:22:55 -04:00
|
|
|
## Style guide
|
|
|
|
|
2014-10-29 19:43:18 -04:00
|
|
|
If you have questions about how to write for Docker's documentation (e.g.,
|
|
|
|
questions about grammar, syntax, formatting, styling, language, or tone) please
|
|
|
|
see the [style guide](sources/contributing/docs_style-guide.md). If something
|
|
|
|
isn't clear in the guide, please submit a PR to help us improve it.
|
2013-03-25 22:52:52 -04:00
|
|
|
|
2014-05-04 20:38:44 -04:00
|
|
|
## Working using GitHub's file editor
|
|
|
|
|
2014-06-14 18:55:24 -04:00
|
|
|
Alternatively, for small changes and typos you might want to use GitHub's built-
|
2014-05-13 20:22:55 -04:00
|
|
|
in file editor. It allows you to preview your changes right on-line (though
|
|
|
|
there can be some differences between GitHub Markdown and [MkDocs
|
|
|
|
Markdown](http://www.mkdocs.org/user-guide/writing-your-docs/)). Just be
|
|
|
|
careful not to create many commits. And you must still [sign your
|
|
|
|
work!](../CONTRIBUTING.md#sign-your-work)
|
2014-05-04 20:38:44 -04:00
|
|
|
|
2014-10-07 21:44:01 -04:00
|
|
|
## Branches
|
|
|
|
|
2014-10-29 19:43:18 -04:00
|
|
|
**There are two branches related to editing docs**: `master` and `docs`. You
|
|
|
|
should always edit the documentation on a local branch of the `master`
|
2014-10-07 21:44:01 -04:00
|
|
|
branch, and send a PR against `master`.
|
|
|
|
|
2014-10-29 19:43:18 -04:00
|
|
|
That way your fixes will automatically get included in later releases, and docs
|
2014-10-07 21:44:01 -04:00
|
|
|
maintainers can easily cherry-pick your changes into the `docs` release branch.
|
|
|
|
In the rare case where your change is not forward-compatible, you may need to
|
|
|
|
base your changes on the `docs` branch.
|
|
|
|
|
|
|
|
Also, now that we have a `docs` branch, we can keep the
|
|
|
|
[http://docs.docker.com](http://docs.docker.com) docs up to date with any bugs
|
|
|
|
found between Docker code releases.
|
|
|
|
|
|
|
|
> **Warning**: When *reading* the docs, the
|
|
|
|
> [http://docs-stage.docker.com](http://docs-stage.docker.com) documentation may
|
|
|
|
> include features not yet part of any official Docker release. The `beta-docs`
|
|
|
|
> site should be used only for understanding bleeding-edge development and
|
|
|
|
> `docs.docker.com` (which points to the `docs` branch`) should be used for the
|
|
|
|
> latest official release.
|
|
|
|
|
2014-05-04 20:38:44 -04:00
|
|
|
## Publishing Documentation
|
2014-02-18 22:21:12 -05:00
|
|
|
|
2014-10-29 19:43:18 -04:00
|
|
|
To publish a copy of the documentation you need to have Docker up and running on
|
|
|
|
your machine. You'll also need a `docs/awsconfig` file containing the settings
|
|
|
|
you need to access the AWS bucket you'll be deploying to.
|
|
|
|
|
2014-09-02 20:44:36 -04:00
|
|
|
The release script will create an s3 if needed, and will then push the files to it.
|
2013-04-08 23:10:47 -04:00
|
|
|
|
2014-05-13 20:22:55 -04:00
|
|
|
[profile dowideit-docs] aws_access_key_id = IHOIUAHSIDH234rwf....
|
|
|
|
aws_secret_access_key = OIUYSADJHLKUHQWIUHE...... region = ap-southeast-2
|
2013-04-08 23:10:47 -04:00
|
|
|
|
2014-05-13 20:22:55 -04:00
|
|
|
The `profile` name must be the same as the name of the bucket you are deploying
|
|
|
|
to - which you call from the `docker` directory:
|
2013-07-31 16:44:10 -04:00
|
|
|
|
2014-04-26 09:53:17 -04:00
|
|
|
make AWS_S3_BUCKET=dowideit-docs docs-release
|
2013-10-15 18:52:21 -04:00
|
|
|
|
2014-08-27 01:19:00 -04:00
|
|
|
This will publish _only_ to the `http://bucket-url/v1.2/` version of the
|
|
|
|
documentation.
|
|
|
|
|
|
|
|
If you're publishing the current release's documentation, you need to
|
|
|
|
also update the root docs pages by running
|
|
|
|
|
|
|
|
make AWS_S3_BUCKET=dowideit-docs BUILD_ROOT=yes docs-release
|
|
|
|
|
2014-10-29 19:43:18 -04:00
|
|
|
> **Note:**
|
|
|
|
> if you are using Boot2Docker on OSX and the above command returns an error,
|
2014-09-02 20:44:36 -04:00
|
|
|
> `Post http:///var/run/docker.sock/build?rm=1&t=docker-docs%3Apost-1.2.0-docs_update-2:
|
|
|
|
> dial unix /var/run/docker.sock: no such file or directory', you need to set the Docker
|
|
|
|
> host. Run `$(boot2docker shellinit)` to see the correct variable to set. The command
|
|
|
|
> will return the full `export` command, so you can just cut and paste.
|
|
|
|
|
|
|
|
## Cherry-picking documentation changes to update an existing release.
|
2014-08-27 01:19:00 -04:00
|
|
|
|
|
|
|
Whenever the core team makes a release, they publish the documentation based
|
|
|
|
on the `release` branch (which is copied into the `docs` branch). The
|
|
|
|
documentation team can make updates in the meantime, by cherry-picking changes
|
|
|
|
from `master` into any of the docs branches.
|
|
|
|
|
|
|
|
For example, to update the current release's docs:
|
|
|
|
|
|
|
|
git fetch upstream
|
|
|
|
git checkout -b post-1.2.0-docs-update-1 upstream/docs
|
|
|
|
# Then go through the Merge commit linked to PR's (making sure they apply
|
|
|
|
to that release)
|
|
|
|
# see https://github.com/docker/docker/commits/master
|
|
|
|
git cherry-pick -x fe845c4
|
|
|
|
# Repeat until you have cherry picked everything you will propose to be merged
|
|
|
|
git push upstream post-1.2.0-docs-update-1
|
|
|
|
|
2014-09-02 20:44:36 -04:00
|
|
|
Then make a pull request to merge into the `docs` branch, __NOT__ into master.
|
2014-08-27 01:19:00 -04:00
|
|
|
|
2014-09-02 20:44:36 -04:00
|
|
|
Once the PR has the needed `LGTM`s, merge it, then publish to our beta server
|
2014-08-27 01:19:00 -04:00
|
|
|
to test:
|
|
|
|
|
|
|
|
git fetch upstream
|
|
|
|
git checkout post-1.2.0-docs-update-1
|
|
|
|
git reset --hard upstream/post-1.2.0-docs-update-1
|
|
|
|
make AWS_S3_BUCKET=beta-docs.docker.io BUILD_ROOT=yes docs-release
|
|
|
|
|
|
|
|
Then go to http://beta-docs.docker.io.s3-website-us-west-2.amazonaws.com/
|
2014-09-02 20:44:36 -04:00
|
|
|
to view your results and make sure what you published is what you wanted.
|
2014-08-27 01:19:00 -04:00
|
|
|
|
|
|
|
When you're happy with it, publish the docs to our live site:
|
|
|
|
|
|
|
|
make AWS_S3_BUCKET=docs.docker.com BUILD_ROOT=yes docs-release
|
2014-09-04 16:32:16 -04:00
|
|
|
|
|
|
|
Note that the new docs will not appear live on the site until the cache (a complex,
|
|
|
|
distributed CDN system) is flushed. This requires someone with S3 keys. Contact Docker
|
|
|
|
(Sven Dowideit or John Costa) for assistance.
|
2014-08-27 01:19:00 -04:00
|
|
|
|