Creating web application for Docker using JavaScript

Jainsiddhant
3 min readJun 25, 2021

JavaScript is a programming language that conforms to the ECMAScript specification. JavaScript is high-level, often just-in-time compiled, and multi-paradigm. It has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first- class functions. It is one of the core technologies of the World Wide Web. Over 97% of websites use it client-side for web page behavior. In this blog, we are going to see how we can make user friendly web portal for Docker using JavaScript and RHEL8.

To make a web portal first we have to know how we can make a web server using RHEL8. For this first we have to launch a Redhat Linux OS and configure yum in it. Then we can make a web server using command yum install httpd. Once the installation is done, use systemctl restart httpd command to start the service. Now your OS will act as a web server. Now this OS contains one directory /var/www/html where we can write all our codes required to create web application.

Now to access any program in a system without login in that system we need ip address of that system. Once we know the ip address of the system, on our behalf some program in the same system provide a way like interface which helps us to use the program in the system without login in . This program is known as Common Gateway Interface(CGI). It is the base of any web technology . All these codes can be written in a directory /var/www/cgi-bin.

Once code is written in both the directories we can access the program using web browser . The syntax of accessing is : “http://ip_address_of_system/file_name ”. Example: http:192.168.0.104/docker.html.

To see all the codes , you can refer the following github repository:

https://github.com/siddhantjain603/task-7.git

After writing all the necessary codes, when i access docker.html (this file contains all the HTML, CSS and JS code) using web browser i got an interface like this:

Now i can run any docker command by writing in the input box provided and click on submit to see the outputs. Some of the screenshots of the command that i run are attached below:

docker ps command :

docker images command :

docker run command :

docker rm command :

docker exec command :

Once you are done with running the commands , press exit button. This will redirect you to exit_docker.html

exit_docker.html

Open for any Queries and Suggestions .

Thank you

--

--