【问题标题】:OpenCPU Docker fails to restart after it is stopped onceOpenCPU Docker 停止一次后无法重启
【发布时间】:2018-03-08 06:56:03
【问题描述】:

我使用

安装了 opencpu Docker 映像

docker pull opencpu/ubuntu-16.04

第一次成功启动。但是如果我终止进程并尝试使用命令再次启动它

docker run -it imageID

每次都会终止。需要有关如何成功启动它的建议。

    Desktop$ docker run -it d98852787b8e
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.4. Set the 'ServerName' directive globally to suppress this message
[Thu Mar 08 06:34:52.836970 2018] [ssl:warn] [pid 11] AH01909: 172.17.0.4:443:0 server certificate does NOT include an ID which matches the server name
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.4. Set the 'ServerName' directive globally to suppress this message
[Thu Mar 08 06:34:52.849109 2018] [ssl:warn] [pid 11] AH01909: 172.17.0.4:443:0 server certificate does NOT include an ID which matches the server name
[Thu Mar 08 06:34:52.849219 2018] [core:warn] [pid 11] AH00098: pid file /var/run/apache2/apache2.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Mar 08 06:34:52.851132 2018] [mpm_prefork:notice] [pid 11] AH00163: Apache/2.4.18 (Ubuntu) mod_R/1.2.7 R/3.2.2 OpenSSL/1.0.2g mod_apreq2-20090110/2.8.0 configured -- resuming normal operations
[Thu Mar 08 06:34:52.851152 2018] [core:notice] [pid 11] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
[Thu Mar 08 06:34:52.872738 2018] [mpm_prefork:notice] [pid 11] AH00170: caught SIGWINCH, shutting down gracefully
Using locale: en_US.UTF-8 
Using locale: en_US.UTF-8 
AppArmor not available. Running OpenCPU without security profile but with rlimits.
Using locale: en_US.UTF-8 
AppArmor not available. Running OpenCPU without security profile but with rlimits.
AppArmor not available. Running OpenCPU without security profile but with rlimits.
Using locale: en_US.UTF-8 
Using locale: en_US.UTF-8 
AppArmor not available. Running OpenCPU without security profile but with rlimits.
AppArmor not available. Running OpenCPU without security profile but with rlimits.
Loading config from /usr/lib/opencpu/library/opencpu/config/defaults.conf
Loading config from /usr/lib/opencpu/library/opencpu/config/defaults.conf
Loading config from /etc/opencpu/server.conf
Loading config from /usr/lib/opencpu/library/opencpu/config/defaults.conf
Loading config from /etc/opencpu/server.conf
Loading config from /usr/lib/opencpu/library/opencpu/config/defaults.conf
OpenCPU cloud server ready.
OpenCPU cloud server ready.
Loading config from /etc/opencpu/server.conf
Loading config from /etc/opencpu/server.conf
OpenCPU cloud server ready.
OpenCPU cloud server ready.
Loading config from /usr/lib/opencpu/library/opencpu/config/defaults.conf
Loading config from /etc/opencpu/server.conf
OpenCPU cloud server ready.
rserver[8]: ERROR system error 10 (No child processes); OCCURRED AT: rstudio::core::Error rstudio::server::app_armor::enforceRestricted() /home/ubuntu/rstudio/src/cpp/server/ServerAppArmor.cpp:90; LOGGED FROM: int main(int, char* const*) /home/ubuntu/rstudio/src/cpp/server/ServerMain.cpp:513
Terminated

【问题讨论】:

  • 执行 docker ps -a 并在此处列出输出
  • @vamsi [/Desktop$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b16b93d2464f d98852787b8e "/bin/sh -c '/usr/li…" About an hour ago Exited (143) About an hour ago vigilant_yalow 9069bf39c689 d98852787b8e "/bin/sh -c '/usr/li…" About an hour ago Exited (143) About an hour ago heuristic_albattani]
  • 你的主机是什么...让我猜猜...是不是 Mac...
  • 尝试删除所有docker镜像和容器docker system prune -a然后启动容器
  • @SoumenMukherjee 我使用的是 Ubuntu 操作系统

标签: docker docker-machine opencpu


【解决方案1】:

也许这可以给你一些提示......这不是完全的解决方案,但如果在高层次上给你什么可能是原因并导致解决方案i.enter link description here

【讨论】:

    【解决方案2】:

    这似乎是rstudio-server 包的问题。我会将上面建议的解决方法 (server-app-armor-enabled=0) 添加到 opencpu docker 映像中。

    请注意,opencpu/base 映像确实安装了 rstudio,因此您可能想试试这个。

    【讨论】:

      【解决方案3】:

      什么是输出 sudo docker logs <container-name> ? 很可能它表明 httpd pid 存在。这意味着您需要删除容器中的 apache2.pid。但是现在由于容器没有启动,黑客就是编辑位于/var/lib/docker/containers/<container-long-id>/ 的容器的 config.v2.json 文件 在 CMD 部分,将“service cron start && apachectl -DFOREGROUND”更改为“rm -f /var/run/apache2/apache2.pid && service cron start && apachectl -DFOREGROUND”。这将确保您的容器将启动。为我工作!

      【讨论】:

        猜你喜欢
        • 2019-01-18
        • 2015-09-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-11-01
        • 2017-11-02
        • 1970-01-01
        • 2015-09-14
        相关资源
        最近更新 更多