繁体   English   中英

Docker 容器 CentOs 与 Apache

[英]Docker container CentOs with Apache

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

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

这是我的 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"]

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

"

我一直在努力解决同样的问题,我终于让它工作了。 希望适用于 Windows,如果您有任何问题,请告诉我,我会尽力提供帮助。

https:\/\/github.com\/davidany\/centos7_ci3_apache_php56<\/a>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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