apche未能在docker集装箱开始

我已经在dockerfile的帮助下创build了一个docker容器。

FROM ubuntu:12.04 RUN apt-get update && apt-get install -y apache2 && apt-get clean ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2 EXPOSE 80 CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"] 

我已经创build了一个容器,它运行成功。 当我停止docker服务,并再次启动容器。 容器启动成功,但Apache无法启动

 [root@localhost ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4283f23b1785 ubuntu/webserver "/usr/sbin/apache2..." 20 hours ago Up 8 minutes 0.0.0.0:80->80/tcp stoic_swartz 

所以,我login到容器,并检查apache2状态

 [root@localhost ~]# docker exec -it stoic_swartz bash root@4283f23b1785:/# /etc/init.d/apache2 status Apache2 is NOT running. root@4283f23b1785:/# /etc/init.d/apache2 start * Starting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2 for ServerName (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Action 'start' failed. The Apache error log may have more information. 

为什么apache无法启动?

错误在那里:

 Unable to open logs 

也许你正在运行所有的东西,而Apache希望用户的万维网数据是所有者的文件;)