Configure WebServer On Docker !!
Configuring HTTPD Server on Docker Container
Step 1: Choose an Base Image First !
Now Run Container with That Image !!
Get the Shell of that Container !!
Step 2: Install the (httpd) !!
Now put an Test Page at the Folder of the html…
Step 3: Lets Start the Service of the httpd . But in the centos image we not have the systemctl command to start …
So, Need Not worry about lets got to Our Base OS and see that which File that systemctl Command Executing …
So, When run the systemctl then it run the highlighted file !
Step 4: Lets Start the Service !!
Step 5: Test the Page From our Base OS !!
Step 6: Now , Lets make the Clone of this Image and Push it To DockerHub..
Lets Run Again Our Clone Image .. And See that our httpd server is still running or Not 🤔. But it will Not Work Because we not make that Service For the Permenent . So, For Making It Permanent You Save that Executable File Location at → /root/.bashrc (Now Whenever Your Container Lunch then This File Always Run So, Your that Executable will also run automatically)…
→ I have Also Created the DockerFile to Build This Image easily …
GitHub_Link → https://github.com/Shashwatsingh22/DockerFiles
→ DockerHub Link → https://hub.docker.com/repository/docker/shashwat22/httpd_web_config