Initial copy edits to builds.md

Revised to match new UI, fixed links, copy edits and improvements.

Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredlf)

More revisions to builds.md

Corrections to automated build process, copy edits.

Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredlf)

Edits based on Sonat's feedback

Docker-DCO-1.1-Signed-off-by: Fred Lifton <fred.lifton@docker.com> (github: fredlf)
This commit is contained in:
Fred Lifton 2014-06-30 18:28:25 -07:00
parent f0aba1aad4
commit 27c34f3eb9
1 changed files with 60 additions and 55 deletions

View File

@ -3,62 +3,67 @@ page_description: Docker Hub Automated Builds
page_keywords: Docker, docker, registry, accounts, plans, Dockerfile, Docker Hub, docs, documentation, trusted, builds, trusted builds, automated builds page_keywords: Docker, docker, registry, accounts, plans, Dockerfile, Docker Hub, docs, documentation, trusted, builds, trusted builds, automated builds
# Automated Builds on Docker Hub # Automated Builds on Docker Hub
## Automated Builds ## About Automated Builds
*Automated Builds* is a special feature allowing you to specify a source *Automated Builds* are a special feature of Docker Hub which allow you to use
repository with a `Dockerfile` to be built by the [Docker Hub's](https://hub.docker.com) build clusters to automatically create images from
[Docker Hub](https://hub.docker.com) build clusters. The system will a specified `Dockerfile` and a GitHub or Bitbucket repo (or "context"). The system will
clone your repository and build the `Dockerfile` using the repository as clone your repository and build the image described by the `Dockerfile` using the
the context. The resulting image will then be uploaded to the registry repository as the context. The resulting automated image will then be uploaded to the
and marked as an *Automated Build*. Docker Hub registry and marked as an *Automated Build*.
Automated Builds have a number of advantages. For example, users of Automated Builds have several advantages:
*your* Automated Build can be certain that the resulting image was built
exactly how it claims to be.
Furthermore, the `Dockerfile` will be available to anyone browsing your repository * Users of *your* Automated Build can trust that the resulting image was built exactly as
on the registry. Another advantage of the Automated Builds feature is the automated specified.
builds. This makes sure that your repository is always up to date.
Automated Builds are supported for both public and private repositories * The `Dockerfile` will be available to anyone with access to your repository
on both [GitHub](http://github.com) and on the Docker Hub registry.
[BitBucket](https://bitbucket.org/).
### Setting up Automated Builds with GitHub * Because the process is automated, Automated Builds help to make sure that your
repository is always up to date.
In order to setup an Automated Build, you need to first link your Automated Builds are supported for both public and private repositories on both
[Docker Hub](https://hub.docker.com) account with a GitHub one. This [GitHub](http://github.com) and [Bitbucket](https://bitbucket.org/).
To use Automated Builds, you must have an
[account on Docker Hub](http://docs.docker.com/userguide/dockerhub/#creating-a-docker-hub-account)
and on GitHub and/or Bitbucket.
## Setting up Automated Builds with GitHub
In order to set up an Automated Build, you need to first link your
[Docker Hub](https://hub.docker.com) account with a GitHub account. This
will allow the registry to see your repositories. will allow the registry to see your repositories.
> *Note:* > *Note:*
> We currently request access for *read* and *write* since > Automated Builds currently require *read* and *write* access since
> [Docker Hub](https://hub.docker.com) needs to setup a GitHub service > [Docker Hub](https://hub.docker.com) needs to setup a GitHub service
> hook. Although nothing else is done with your account, this is how > hook. We have no choice here, this is how GitHub manages permissions, sorry!
> GitHub manages permissions, sorry! > We do guarantee nothing else will be touched in your account.
Click on the [Automated Builds To get started, log into your Docker Hub account and click the "+ Add Repository" button
tab](https://registry.hub.docker.com/builds/) to get started and then at the upper right of the screen. Then select
select [+ Add New](https://registry.hub.docker.com/builds/add/). [Automated Build](https://registry.hub.docker.com/builds/add/).
Select the [GitHub service](https://registry.hub.docker.com/associate/github/). Select the [GitHub service](https://registry.hub.docker.com/associate/github/).
Then follow the instructions to authorize and link your GitHub account Then follow the onscreen instructions to authorize and link your GitHub account to Docker Hub.
to Docker Hub.
#### Creating an Automated Build ### Creating an Automated Build
You can [create an Automated Build](https://registry.hub.docker.com/builds/github/select/) You can [create an Automated Build](https://registry.hub.docker.com/builds/github/select/)
from any of your public or private GitHub repositories with a `Dockerfile`. from any of your public or private GitHub repositories with a `Dockerfile`.
#### GitHub organizations ### GitHub organizations
GitHub organizations appear once your membership to that organization is GitHub organizations will appear once your membership to that organization is
made public on GitHub. To verify, you can look at the members tab for your made public on GitHub. To verify, you can look at the members tab for your
organization on GitHub. organization on GitHub.
#### GitHub service hooks ### GitHub service hooks
You can follow the below steps to configure the GitHub service hooks for your Follow the steps below to configure the GitHub service hooks for your
Automated Build: Automated Build:
<table class="table table-bordered"> <table class="table table-bordered">
@ -73,65 +78,65 @@ Automated Build:
<tr> <tr>
<td>1.</td> <td>1.</td>
<td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_settings.png"></td> <td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_settings.png"></td>
<td>Login to Github.com, and visit your Repository page. Click on the repository "Settings" link. You will need admin rights to the repository in order to do this. So if you don't have admin rights, you will need to ask someone who does.</td> <td>Log in to Github.com, and visit your Repository page. Click on repository "Settings" on the right side of the page. You must have admin privileges to the repository in order to do this.</td>
</tr> </tr>
<tr> <tr>
<td>2.</td> <td>2.</td>
<td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_service_hooks.png" alt="Service Hooks"></td> <td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_service_hooks.png" alt="Service Hooks"></td>
<td>Click on the "Service Hooks" link</td></tr><tr><td>3.</td><td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_docker_service_hook.png" alt="Find the service hook labeled Docker"></td><td>Find the service hook labeled "Docker" and click on it.</td></tr><tr><td>4.</td><td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_service_hook_docker_activate.png" alt="Activate Service Hooks"></td> <td>Click on "Webhooks & Services" on the left side of the page.</td></tr><tr><td>3.</td><td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_docker_service_hook.png" alt="Find the service labeled Docker"></td><td>Find the service labeled "Docker" and click on it.</td></tr><tr><td>4.</td><td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_service_hook_docker_activate.png" alt="Activate Service Hooks"></td>
<td>Click on the "Active" checkbox and then the "Update settings" button, to save changes.</td> <td>Make sure the "Active" checkbox is selected and click the "Update service" button to save your changes.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
### Setting up Automated Builds with BitBucket ## Setting up Automated Builds with Bitbucket
In order to setup an Automated Build, you need to first link your In order to setup an Automated Build, you need to first link your
[Docker Hub](https://hub.docker.com) account with a BitBucket one. This [Docker Hub](https://hub.docker.com) account with a Bitbucket account. This
will allow the registry to see your repositories. will allow the registry to see your repositories.
Click on the [Automated Builds tab](https://registry.hub.docker.com/builds/) to To get started, log into your Docker Hub account and click the "+ Add Repository" button at
get started and then select [+ Add the upper right of the screen. Then select [Automated Build](https://registry.hub.docker.com/builds/add/).
New](https://registry.hub.docker.com/builds/add/).
Select the [BitBucket Select the [Bitbucket
service](https://registry.hub.docker.com/associate/bitbucket/). service](https://registry.hub.docker.com/associate/bitbucket/).
Then follow the instructions to authorize and link your BitBucket account Then follow the onscreen instructions to authorize and link your Bitbucket account
to Docker Hub. to Docker Hub.
#### Creating an Automated Build ### Creating an Automated Build
You can [create an Automated Build]( You can [create an Automated Build](
https://registry.hub.docker.com/builds/bitbucket/select/) from any of your https://registry.hub.docker.com/builds/bitbucket/select/) from any of your
public or private BitBucket repositories with a `Dockerfile`. public or private Bitbucket repositories with a `Dockerfile`.
### The Dockerfile and Automated Builds ## The Dockerfile and Automated Builds
During the build process, we copy the contents of your `Dockerfile`. We also During the build process, we copy the contents of your `Dockerfile`. We also
add it to the [Docker Hub](https://hub.docker.com) for the Docker community add it to the [Docker Hub](https://hub.docker.com) for the Docker community (for public
to see on the repository page. repos) or approved team members/orgs (for private repos) to see on the repository page
(if your repo is public).
### README.md ## README.md
If you have a `README.md` file in your repository, we will use that as the If you have a `README.md` file in your repository, it will be used as the
repository's full description. repository's full description.
> **Warning:** > **Warning:**
> If you change the full description after a build, it will be > If you change the full description after a build, it will be
> rewritten the next time the Automated Build has been built. To make changes, > rewritten the next time the Automated Build has been built. To make changes,
> modify the README.md from the Git repository. We will look for a README.md > modify the `README.md` from the Git repository. The build process will look for a
> in the same directory as your `Dockerfile`. > `README.md` in the same directory as your `Dockerfile`.
### Build triggers ### Build triggers
If you need another way to trigger your Automated Builds outside of GitHub If you need a way to trigger Automated Builds outside of GitHub
or BitBucket, you can setup a build trigger. When you turn on the build or Bitbucket, you can set up a build trigger. When you turn on the build
trigger for an Automated Build, it will give you a URL to which you can trigger for an Automated Build, it will give you a URL to which you can
send POST requests. This will trigger the Automated Build process, which send POST requests. This will trigger the Automated Build, which
is similar to GitHub webhooks. is similar to GitHub webhooks.
Build Triggers are available under the Settings tab of each Automated Build. Build triggers are available under the Settings tab of each Automated Build.
> **Note:** > **Note:**
> You can only trigger one build at a time and no more than one > You can only trigger one build at a time and no more than one