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

Creating a GitHub repository

If you don't have a GitHub account, you can create one for free at https://github.com/join. In this example, we will create a dedicated public repository called nginx-demo-index in the hands-on-kubernetes-on-windows organization. Let's get started:

  1. Navigate to https://github.com/ and use the + sign to create a new repository:

Hosting an organization is not required; you can just use your own personal namespace. The repository is intended to only contain the application source code (in our case, just a static index.html web page) and the Dockerfile that's required to build the image, which aligns with the suggested best practices for Docker development.

  1. After you have created the repository, we can push some source code for the image. You can find the source code for our minimalistic Docker image for hosting a static web page using nginx in this book's GitHub repository: https://github.com/PacktPublishing/Hands-On-Kubernetes-on-Windows/tree/master/Chapter03/02_nginx-demo-index.
  2. In order to clone the newly created repository, in PowerShell, navigate to the directory where you would like to have the repository and use the git clone command:
git clone https://github.com/<userName>/<repositoryName>.git
  1. Copy all the required source files to the repository and perform a push using the git push command:
git add -A
git commit -am "Docker image source code"
git push -u origin master
  1. At this point, you should be able to see the files in the repository when you navigate to GitHub web page, for example, https://github.com/hands-on-kubernetes-on-windows/nginx-demo-index:

The next step is to create the actual Docker Hub repository and configure autobuild. Let's proceed!

主站蜘蛛池模板: 上思县| 旬阳县| 盐津县| 云阳县| 洛隆县| 德格县| 泸定县| 宣恩县| 阜阳市| 榆社县| 琼中| 罗定市| 黑山县| 石渠县| 喀喇沁旗| 云林县| 文昌市| 磐安县| 丰都县| 格尔木市| 巴林右旗| 确山县| 碌曲县| 福鼎市| 洛宁县| 同心县| 新化县| 桃源县| 楚雄市| 广平县| 康保县| 通州市| 鹿邑县| 遂平县| 镇江市| 收藏| 天津市| 琼中| 遵义市| 陆良县| 永丰县|