Configuring WebServer & Python Interpreter on Docker Container

Task 7.2

  1. Configuring Webserver (HTTPD) Server on Docker Container.
  2. Setting up Python Interpreter and running Python Code on Docker Container.

All setup is going under the docker container.

docker pull httpd
docker run -it — name python-os httpd

httpd is the webserver rpm provided by apache.

yum install httpd net-tools -y

net-tools rpm provides ifconfig and netstat commands.

By default, systemctl doesn't support inside a docker container.

systemctl behind call /usr/sbin/httpd or httpd

httpd 
or
/usr/sbin/httpd

To check is web server service is running or not.

netstat -tnlp
firefox 172.17.0.2

Run this command in the BaseOS.

Otherwise, you can run curl 172.17.0.2 inside docker or outside docker container to see the output.

By default, we have Python Interpreter.

python2

--

--

Neeraj Singh Negi

AWS | Openstack | GCP | Ansible | Redhat 8 Linux | Docker | Jenkins | Kubernetes | Hadoop | Python | Machine Learning