Automated Builds with Bitbucket
If you’ve previously linked your Docker Hub account to your Bitbucket account, you’ll be able to skip to Creating an Automated Build.
Linking to your Bitbucket account
In order to set up an Automated Build of a repository on Bitbucket, you need to link your Docker Hub account to a Bitbucket account. This will allow the registry to see your Bitbucket repositories.
To add, remove or view your linked account, go to the “Linked Accounts & Services” section of your Hub profile “Settings”.
Then follow the onscreen instructions to authorize and link your Bitbucket account to Docker Hub. Once it is linked, you’ll be able to create a Docker Hub repository from which to create the Automatic Build.
Creating an Automated Build
You can create an Automated Build from any of your
public or private Bitbucket repositories with a Dockerfile
.
To get started, log into your Docker Hub account and click the “Create ▼” menu item at the top right of the screen. Then select Create Automated Build.
Select the the linked Bitbucket account, and then choose a repository to set up an Automated Build for.
The Bitbucket service hook
When you create an Automated Build, a POST
service hook should get automatically
added to your Bitbucket repository.
To confirm or modify the service hook log in to Bitbucket, then navigate to the repository, click “Settings” (the gear), then select “Services”. You must have Administrator privileges on the repository to view or modfy this setting.
The image below shows the correct POST
hook pointing to
https://registry.hub.docker.com/hooks/bitbucket
.