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

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

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
# Automated Builds on Docker Hub
## Automated Builds
## About Automated Builds
*Automated Builds* is a special feature allowing you to specify a source
repository with a `Dockerfile` to be built by the
[Docker Hub](https://hub.docker.com) build clusters. The system will
clone your repository and build the `Dockerfile` using the repository as
the context. The resulting image will then be uploaded to the registry
and marked as an *Automated Build*.
*Automated Builds* are a special feature of Docker Hub which allow you to use
[Docker Hub's](https://hub.docker.com) build clusters to automatically create images from
a specified `Dockerfile` and a GitHub or Bitbucket repo (or "context"). The system will
clone your repository and build the image described by the `Dockerfile` using the
repository as the context. The resulting automated image will then be uploaded to the
Docker Hub registry and marked as an *Automated Build*.
Automated Builds have a number of advantages. For example, users of
*your* Automated Build can be certain that the resulting image was built
exactly how it claims to be.
Automated Builds have several advantages:
Furthermore, the `Dockerfile` will be available to anyone browsing your repository
on the registry. Another advantage of the Automated Builds feature is the automated
builds. This makes sure that your repository is always up to date.
* Users of *your* Automated Build can trust that the resulting image was built exactly as
specified.
Automated Builds are supported for both public and private repositories
on both [GitHub](http://github.com) and
[BitBucket](https://bitbucket.org/).
* The `Dockerfile` will be available to anyone with access to your repository
on the Docker Hub registry.
### 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
[Docker Hub](https://hub.docker.com) account with a GitHub one. This
Automated Builds are supported for both public and private repositories on both
[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.
> *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
> hook. Although nothing else is done with your account, this is how
> GitHub manages permissions, sorry!
> hook. We have no choice here, this is how GitHub manages permissions, sorry!
> We do guarantee nothing else will be touched in your account.
Click on the [Automated Builds
tab](https://registry.hub.docker.com/builds/) to get started and then
select [+ Add New](https://registry.hub.docker.com/builds/add/).
To get started, log into your Docker Hub account and click the "+ Add Repository" button
at the upper right of the screen. Then select
[Automated Build](https://registry.hub.docker.com/builds/add/).
Select the [GitHub service](https://registry.hub.docker.com/associate/github/).
Then follow the instructions to authorize and link your GitHub account
to Docker Hub.
Then follow the onscreen instructions to authorize and link your GitHub account 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/)
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
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:
<table class="table table-bordered">
@ -73,65 +78,65 @@ Automated Build:
<tr>
<td>1.</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>
<td>2.</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 the "Active" checkbox and then the "Update settings" button, to save changes.</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>Make sure the "Active" checkbox is selected and click the "Update service" button to save your changes.</td>
</tr>
</tbody>
</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
[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.
Click on the [Automated Builds tab](https://registry.hub.docker.com/builds/) to
get started and then select [+ Add
New](https://registry.hub.docker.com/builds/add/).
To get started, log into your Docker Hub account and click the "+ Add Repository" button at
the upper right of the screen. Then select [Automated Build](https://registry.hub.docker.com/builds/add/).
Select the [BitBucket
Select the [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.
#### Creating an Automated Build
### Creating an Automated Build
You can [create an Automated Build](
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
add it to the [Docker Hub](https://hub.docker.com) for the Docker community
to see on the repository page.
add it to the [Docker Hub](https://hub.docker.com) for the Docker community (for public
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.
> **Warning:**
> 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,
> modify the README.md from the Git repository. We will look for a README.md
> in the same directory as your `Dockerfile`.
> modify the `README.md` from the Git repository. The build process will look for a
> `README.md` in the same directory as your `Dockerfile`.
### Build triggers
If you need another way to trigger your Automated Builds outside of GitHub
or BitBucket, you can setup a build trigger. When you turn on the build
If you need a way to trigger Automated Builds outside of GitHub
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
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.
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:**
> You can only trigger one build at a time and no more than one