Today I am here to tell you about how to configure an HTTPD server on a Docker container.
firstly we have to configure docker on the system .
- Go to /etc/yum.repos.d/ path and create a repo file for docker.
- The baseurl is https://download.docker.com/linux/centos/7/x86_64/stable/
3. And run the “yum repolist” command to check link work properly or not.
4. To install the docker command “yum install docker-ce — nobest” .
5. Start the service command “systemctl start docker”.
Download Any image on the docker container with the help of this link:-
Run the docker image on system command is
docker run -it — name webb centos:latest
In Docker container, if yum command not found an error or curl error (6) comes then go to redhat path “vim /etc/firewalld/firewalld.conf”
Hope your error will be resolve by this process.
Here ifconfig command will also not run we have to install “net-tools” then we have to run the ifconfig command on the docker.
Come to the task……
CONFIGURE HTTPD ON DOCKER
- Install Httpd service on docker container command “yum install httpd” in my case i have already downloaded.
- Then go to this path cd /var/www/html and create a html file by vi command.
- Then we have started the service but here systemctl command will not work.
we are using the command “/usr/sbin/httpd” for starting the webserver.
To check service will start or not but here will have only option to check is to see those port number is on or not to check port number command is :- “netstat -tnlp”
- Then we have to search on firefox by IP of the machine.
- Setting up Python Interpreter and running Python Code on Docker Container
First, we check python environment is there or not , to check the python we have command “rpm -q python” or “python3"
Then we have to install python by yum command :- “yum install python3”
we check python is installed or not by command “rpm -q python3” or “python36”
then we have to print python script
Thank you !!!!