- Hands-On Kubernetes on Windows
- Piotr Tylenda
- 228字
- 2021-06-24 16:54:05
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:
- 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>
- Commit and push the code change:
git commit -am "Updated index.html"
git push -u origin master
- 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.
- 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
- 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.
推薦閱讀
- The DevOps 2.3 Toolkit
- Fundamentals of Linux
- Servlet/JSP深入詳解
- Instant 960 Grid System
- PHP 編程從入門(mén)到實(shí)踐
- Android底層接口與驅(qū)動(dòng)開(kāi)發(fā)技術(shù)詳解
- 編程與類(lèi)型系統(tǒng)
- SQL 經(jīng)典實(shí)例
- SSM開(kāi)發(fā)實(shí)戰(zhàn)教程(Spring+Spring MVC+MyBatis)
- Python圖形化編程(微課版)
- App Inventor創(chuàng)意趣味編程進(jìn)階
- 軟件供應(yīng)鏈安全:源代碼缺陷實(shí)例剖析
- 移動(dòng)互聯(lián)網(wǎng)軟件開(kāi)發(fā)實(shí)驗(yàn)指導(dǎo)
- 單片機(jī)原理及應(yīng)用技術(shù)
- OpenCV 3計(jì)算機(jī)視覺(jué):Python語(yǔ)言實(shí)現(xiàn)(原書(shū)第2版)