Automated builds – with GitHub and Bitbucket
We saw earlier how to push Docker images to Docker Hub. Docker Hub allows us to create automated images from a GitHub or Bitbucket repository using its build clusters. The GitHub/Bitbucket repository should contain the Dockerfile and also the content that is to be copied/added inside the image. We will be looking at a GitHub example in upcoming sections.
Getting ready
For this you, will need a valid Docker ID and GitHub account.
Also, visit https://github.com/docker-cookbook/apache2 for the apache2 Dockerfile.
How to do it...
Perform the following steps:
- Log in to Docker Hub (https://hub.docker.com/).
- The first step to create an automated build is to link your GitHub or Bitbucket account. The account-linking feature is available in the
Linked Accounts & Services
web wizard. You can reach this wizard either by navigating through theSettings
menu or viaCreate Automated Build
menu in theCreate
dropdown. Here, we will choose the former option—that...