Hands-On Kubernetes on Windows
上QQ阅读APP看书,第一时间看更新

Creating a sample HTML web page

We will start creating our Docker image by creating a minimalistic HTML "Hello World!" web page. This step mimics implementing an application without any containerization and is a common scenario in application development: you are running a non-containerized application and then you move it to a Docker container.

You can also use the files from this book's GitHub repository to do this, available from:  https://github.com/PacktPublishing/Hands-On-Kubernetes-on-Windows/tree/master/Chapter01/01_docker-helloworld-iis.

Add a new file in Visual Studio Code in your workspace using the Ctrl + N shortcut or by navigating to File > New File. Use the following sample HTML code in the new file:

<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1>Hello World from Windows container!</h1>
</body>
</html>

Save the file (using Ctrl + S) as index.html in your workspace.

Let's proceed with creating the Dockerfile itself.