Docker容器CentOs与Apache

时间:2017-12-14 09:31:15

标签: apache docker centos7

我正在玩Docker。但是当我尝试在容器中构建Centos和Apache Server时,我遇到了Docker的问题。我在Windows 10机器上运行Docker。 CentOS + Apache容器与Maria DB映像相结合。

当我执行docker-compose时,我的Apache容器启动并使用退出代码0关闭imediateli。

这是我的dockerfile:

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"]

这是我的码头工作者。

centreon:
  build: ./centreon
  ports:
    - "80:80"
#  volumes:
#    - "./data"
  links:
   - mariadb
mariadb:
  image: mariadb
  environment:
    MYSQL_ROOT_PASSWORD: notR00tPassword

1 个答案:

答案 0 :(得分:0)

我需要使用" docker-compose up --build"命令。 它在执行之前重建图像。 问题解决了。