We wanted to install and run apache using docker file. So our Dockerfile looks like :
FROM ubuntu
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update
RUN apt-get -y install apache2
EXPOSE 80
CMD ["/etc/init.d/apache2" ,"start", "-D", "FOREGROUND"]
sudo docker build -t my-apache-image .
sudo docker container run -d -P --name my-apache-container my-apache-image
But the docker container does not work . Any help as to why this instruction
"CMD ["/etc/init.d/apache2" ,"start", "-D", "FOREGROUND"]"
does not work ?
FROM httpd:2.4
. hub.docker.com/_/httpd