How to do it...

Perform the following steps:

  1. Log in to Docker Hub (https://hub.docker.com/).
  1. 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 the Settings menu or via Create Automated Build menu in the Create dropdown. Here, we will choose the former option—that is, the Settings menu—which is accessible from the rightmost drop-down menu:
  1. In the preceding wizard, click the Link Github option; in the next screen, you will be presented with two options, as shown in the following screenshot. Here, let us click the Select button under the Public and Private (Recommended) option:
  1. A new window or tab will open for you to key in your GitHub credentials, as shown in the following screenshot:
  1. Having successfully logged in to your GitHub account, continue to Grant permission to the organizations in your GitHub account. In this example, we have granted permission to the docker-cookbook organization. Click the Authorize docker button:

As you can see in the following screenshot, now the Docker Hub account is linked to the GitHub account:

As we can see in the preceding screenshot, the GitHub account is successfully linked to the Docker Hub account. Now, we can proceed to configure the automated build.

  1. Select the Create Automated Build option from the Create drop-down menu, as shown in the following screenshot:
  1. You will be presented with two options: Create Auto-Build for Github and Link Account to link your account to Bitbucket, as shown in the following screenshot:

We will be linking our account with Bitbucket because we have not yet linked any Bitbucket account.

  1. Click on the Create Auto-build option:

  1. Click on the apache2 option, which is the fork of https://github.com/docker-cookbook/apache2:
  1. Provide a short description and click Create:

Hurray! You have successfully automated the build process, and the image build process will get triggered when you make any change in your forked repository.

  1. Now, you can navigate to the Build Details tab to see the build status.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.10.36