Docker 1.9 容器突然停止

Docker 1.9 容器突然停止

我有一个托管 Java 应用程序的 Docker 容器。但我多次看到应用程序关闭,Docker 未运行。

/var/log/daemon.log只看到以下信息,没有错误

Oct 10 10:54:58 or4 docker[18366]: time="2016-10-10T10:54:58.875341257+05:30" level=info msg="POST /v1.21/containers/c1a64d308f45/stop?t=10"
Oct 10 10:54:59 or4 systemd-sysctl[100591]: Overwriting earlier assignment of net/ipv4/tcp_tw_recycle in file '/etc/sysctl.d/99-sysctl.conf'.

以下是输出docker logs <container id>

2016-10-10 10:53:57,242 WARN received SIGTERM indicating exit request
2016-10-10 10:53:57,243 INFO waiting for orchestrator to die
2016-10-10 10:53:57,243 INFO stopped: orchestrator (terminated by SIGTERM)
2016-10-10 11:31:21,137 CRIT Supervisor running as root (no user in config file)
2016-10-10 11:31:21,137 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2016-10-10 11:31:21,170 INFO RPC interface 'supervisor' initialized
2016-10-10 11:31:21,170 WARN cElementTree not installed, using slower XML parser for XML-RPC
2016-10-10 11:31:21,171 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2016-10-10 11:31:21,171 INFO supervisord started with pid 1
2016-10-10 11:31:22,174 INFO spawned: 'orchestrator' with pid 6
2016-10-10 11:31:23,863 INFO success: orchestrator entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-10-10 14:31:43,490 WARN received SIGTERM indicating exit request
2016-10-10 14:31:43,491 INFO waiting for orchestrator to die
2016-10-10 14:31:43,491 INFO stopped: orchestrator (terminated by SIGTERM)
2016-10-10 14:50:10,217 CRIT Supervisor running as root (no user in config file)
2016-10-10 14:50:10,217 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2016-10-10 14:50:10,258 INFO RPC interface 'supervisor' initialized
2016-10-10 14:50:10,258 WARN cElementTree not installed, using slower XML parser for XML-RPC
2016-10-10 14:50:10,258 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2016-10-10 14:50:10,258 INFO supervisord started with pid 1
2016-10-10 14:50:11,261 INFO spawned: 'orchestrator' with pid 6
2016-10-10 14:50:13,103 INFO success: orchestrator entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-10-10 14:57:48,522 WARN received SIGTERM indicating exit request
2016-10-10 14:57:48,522 INFO waiting for orchestrator to die
2016-10-10 14:57:48,523 INFO stopped: orchestrator (terminated by SIGTERM)
2016-10-10 15:43:04,028 CRIT Supervisor running as root (no user in config file)
2016-10-10 15:43:04,028 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2016-10-10 15:43:04,059 INFO RPC interface 'supervisor' initialized
2016-10-10 15:43:04,059 WARN cElementTree not installed, using slower XML parser for XML-RPC
2016-10-10 15:43:04,059 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2016-10-10 15:43:04,059 INFO supervisord started with pid 1
2016-10-10 15:43:05,061 INFO spawned: 'orchestrator' with pid 6
2016-10-10 15:43:06,561 INFO success: orchestrator entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

以下是 docker 文件。

FROM nocindia/java:java8-mvn3.2.5
MAINTAINER "[email protected]"

RUN ln -fns /usr/share/zoneinfo/Asia/Kolkata /etc/localtime

RUN apt-get update && apt-get install -y unzip imagemagick mediainfo

ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
ENV SERVICEMIX_VERSION_MAJOR=F
ENV SERVICEMIX_VERSION_MINOR=I 
ENV SERVICEMIX_VERSION_PATCH=L.M2 
ENV SERVICEMIX_VERSION=${SERVICEMIX_VERSION_MAJOR}.${SERVICEMIX_VERSION_MINOR}.${SERVICEMIX_VERSION_PATCH} 
RUN wget http://www-us.apache.org/dist/servicemix/servicemix-${SERVICEMIX_VERSION_MAJOR}/${SERVICEMIX_VERSION}/apache-servicemix-${SERVICEMIX_VERSION}.zip && \
    unzip -d /opt apache-servicemix-${SERVICEMIX_VERSION}.zip && \
    rm -f apache-servicemix-${SERVICEMIX_VERSION}.zip; 

#  For Karaf Web Console
EXPOSE 8181 

# Orchestrator service running inside karaf
EXPOSE XXXX

# For connecting to karaf console remotely via Karaf client
EXPOSE AAAA

# running mvn tests
EXPOSE BBBBB

# running file upload service
EXPOSE DDDDD

# remove the unwanted files which saves some MB's
RUN apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y \
        && cp -R /usr/share/locale/en\@* /tmp/ && rm -rf /usr/share/locale/* && mv /tmp/en\@* /usr/share/locale/ \
        && rm -rf /var/cache/debconf/*-old && rm -rf /usr/share/doc/*

ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf

ADD timezone /etc/timezone

CMD ["/usr/bin/supervisord"]

AAAAXXXX、 等是占位符。

有人可以向我解释一下可能出了什么问题以及我该如何调试这个问题吗?

环境:-

  • Docker 1.9
  • Debian 8 64 位

答案1

问题不在于 Docker 或其任何配置。外部进程定期重启 Docker,而 Docker 又会重启 Docker 内部运行的 Orchestrator 进程。

相关内容