官术网_书友最值得收藏!

Triggering the Docker Hub autobuild

With the autobuild setup created in the previous section, triggering a new Docker image build is as simple as committing new code to your GitHub repository. In order to do that, you have to do the following:

  1. Introduce a change to the source code for the image on GitHub; for example, modify the index.html file:
<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1>Hello World from nginx container! This is a new version of image for autobuild.</h1>
</body>
</html>
  1. Commit and push the code change:
git commit -am "Updated index.html"
git push -u origin master
  1. In the Builds tab for this image repository on Docker Hub, you should almost immediately see that a new image build has been triggered (source commit: https://github.com/hands-on-kubernetes-on-windows/nginx-demo-index/tree/5ee600041912cdba3c82da5331542f48701f0f28):

If your build fails, you can always inspect the Docker build logs in the build details and Build logs tab.
  1. After the build succeeds, verify your image by running a new container on your Windows machine:
docker run -it --rm `
-p 8080:80 `
packtpubkubernetesonwindows/nginx-demo-index:latest
  1. The image will be automatically pulled from the Docker Hub repository. Navigate to http://localhost:8080 in your web browser. You should see the following output:

Congratulations – you have successfully created and triggered a Docker image autobuild on Docker Hub! In the next section, you will learn how to create a similar setup for Windows-based images using Azure Container Registry.

主站蜘蛛池模板: 柘城县| 大新县| 藁城市| 蚌埠市| 满洲里市| 安图县| 贵德县| 沾化县| 屯留县| 孝昌县| 黄平县| 昌图县| 年辖:市辖区| 忻城县| 讷河市| 新安县| 慈利县| 和硕县| 宜川县| 建昌县| 绍兴市| 通榆县| 突泉县| 黎川县| 开化县| 襄垣县| 教育| 板桥市| 雷波县| 周宁县| 馆陶县| 华坪县| 万盛区| 班戈县| 郎溪县| 紫阳县| 太康县| 朝阳区| 崇阳县| 富蕴县| 南陵县|