Create Container image

In this tutorial, we will learn to create an image of an application. This application is a simple web application built in node.js. Follow the below steps to create an image of this application:

  1. Copy the application\’s repository.

git clone https://github.com/ashish993/helloworld.git

  1. Build the container file. The below command will create container image & we will tag it as helloworldapp

docker build .\\helloworld -t helloworldapp

image1

  1. Check docker images. Run the below command and it will list all the docker images.

docker images

image2

  1. Run the container locally.

docker run -d -p 8080:80 helloworldapp

  1. Navigate to http://localhost:8080 in your browser. The web page will be opened as shown below.

image3

Leave a comment