In this story we will configure Apache’s httpd Webserver on Docker Container.
For downloading docker on RHEL8 first configure yum for docker and then type
yum install docker-ce —-nobest
Then pull an image of the Operating system you like by
docker pull <image_name:version>
Lets’ launch a container named os1 form centos image
docker run -it --name os1 centos
Now lets install httpd software in the docker container.
yum install httpd
In container, systemctl related commands don’t work for this we have to manually start service.
First, write one file named index.html in /var/www/html folder
Now start service
Ignore those warnings, here your service is started.
Now to enable httpd service in container we have to write this same entry into /etc/.bashrc
Now write new entry /usr/sbin/httpd
Now the service is permanently enabled..
Now let us check output from host os means in RHEL8.
My container IP :
Now let us check result
here your webserver is active !!
Thank you for reading …!