JavaScript integration with Docker

Task Description:-

Task 7.1 -

📌 In this task, you have to create a Web Application for Docker (one of the great Containerization Tool which provides the user Platform as a Service (PaaS)) by showing your creativity and UI/UX designing skills to make the web portal user friendly.

📌 This app will help the user to run all the docker commands like:

So Let’s Start:-

  • Before starting this task, you must have httpd installed in your RHEL8.

#yum install httpd (using this command you can install HTTPD server)

  • After install httpd you have to start this server.

#systemctl start httpd (using this command you can start HTTPD server)

  • Then, go to the directory cgi-bin and create the python file. and make an executable file.

#cd /var/www/cgi-bin/

#vi main.py

#chmod +x home.py

After that write a python program in main.py file.

In this program, I’ve import two libraries (I)import cgi (II)import subprocess. CGI library helps us to communicate between client and server and the subprocess library is help us to spawn new processes, connect to their input/output/error pipes, and obtain their return codes.

After that go to the /var/www/html/ directory and create index.html file for client side.

#cd /var/www/html/

#vi index.html

In this program, we will create a responsive web page. we have created a function to the request to the HTTP server and server send back to the response and show the output to the web page.

for example- 192.168.43.84/index.html

After that copy the IP address and hit on the web browser and you have also shown that the web page. you can type any docker command.

Like- #docker images

#docker ps

#docker run -it cento

Thank You :)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store