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
9,065 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 in Docker by MD
• 41,340 points
268 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
3,503 views
0 votes
1 answer

Error:Failed to start redis.service Unit redis-server.service is masked

Hello, If redis.service file is missed in directory path /etc/systemd/system/redis.service so we ...READ MORE

answered May 18 in Docker by Niroj
• 43,540 points
624 views
0 votes
1 answer
0 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
• 57,550 points
656 views
0 votes
1 answer
0 votes
1 answer