Configuring HTTPD Server and Python Interpreter on Docker Container and running Python code in the container.
To configure httpd server on the docker container do the following steps
firstly launch a docker container in interactive mode using the following command
docker container run -t --name httpd_c centos
now install the httpd server in the docker container using yum.
yum install httpd -y
In the centos docker container to start the HTTPD server user need to run the httpd program. httpd program is situated at /usr/sbin/ folder in centos container.
/usr/sbin/httpd
172.17.0.2 is the assigned internal IP of the container. so to check httpd server is running or not, enter the IP of the container on your base OS browser.
Now httpd container is configured.
To configure the python container launch another centos container.
docker container run -it --name python_c centos
now install the python interpreter using yum in the docker container.
yum install python3 -y
to run the python the interpreter simply runs “python3” on the container terminal. python interpreter and its terminal will be launched.
simply write the code and run them.
Hope you find this useful.