简体   繁体   中英

Docker container CentOs with Apache

I'm toying around with Docker. But i have an issue with Docker when trying to build a Centos and Apache Server in a container. I run Docker on my Windows 10 Machine. The CentOS + Apache container, is coupled with a Maria DB image.

FROM centos:centos7
LABEL Author = "Aurelien H."
LABEL Description = "DOCKERFILE : Allows the creation of a Container with a Centreon distribution installed via packages"

#Update and install requirements
RUN yum update -y
RUN yum install -y wget nano centos-release-scl httpd git

#Install Centreon repo
RUN cd /usr/local/src
RUN wget http://yum.centreon.com/standard/3.4/el7/stable/noarch/RPMS/centreon-release-3.4-4.el7.centos.noarch.rpm
RUN yum install -y --nogpgcheck centreon-release-3.4-4.el7.centos.noarch.rpm

#Install Centreon
RUN yum install -y centreon-base-config-centreon-engine centreon centreon-pp-manager
RUN yum clean all
#RUN systemctl enable httpd.service
#RUN systemctl start httpd.service
EXPOSE  80
CMD ["/usr/sbin/httpd","-D","FOREGROUND"]

I needed to use the "docker-compose up --build" command. It rebuild the images before executing them. Problem solved.

"

I have struggled with the same issue, I finally got it working. Hopefully works on windows, if you have any issues, let me know and I'll try to help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM