Dockerfile to install apache server and start httpd service on it

0 votes

I'm trying to install Apache server and copy an index.html file from the host location to Docker container expose port 80 and start the httpd services. I need a Dockerfile for the same. Thank you 

Jan 22, 2019 in Docker by Kali
23,380 views

1 answer to this question.

0 votes

Hey @Kali, That's pretty simple. You could have a Dockerfile something like this:

FROM centos
RUN yum install httpd -y
COPY index.html /var/www/html/

CMD [“/usr/sbin/httpd”,” -D”,” FOREGROUND”]
EXPOSE 80
answered Jan 22, 2019 by Yesha

Related Questions In Docker

0 votes
1 answer

how to install maven,java{jdk}, jenkins.war file & apache tomcat on dockerfile?

Hi, In real scenario docker container is used ...READ MORE

answered May 4, 2020 in Docker by MD
• 95,460 points
2,236 views
+1 vote
1 answer

How to write ansible play book to install docker and start docker container with docker image on multiple host machines

Hi@Shashi, You can do this task easily with ...READ MORE

answered Oct 22, 2020 in Docker by MD
• 95,460 points
6,745 views
0 votes
1 answer
0 votes
1 answer

Dockerfile to install nginx on Ubuntu

Hey @Greg, this is a simple dockerfile ...READ MORE

answered Jul 23, 2019 in Docker by User101
18,860 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,731 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP