Dockerfile supervisord 找不到路径

Dockerfile supervisord cannot find path

出于某种原因,supervisord 在执行 docker 运行 时无法启动...如果我注销 supervisord 的配置存储路径,我可以清楚地看到该文件存在。

以下是我的 Dockerfile 中目前未被注释掉的部分。

FROM ubuntu:16.04
MAINTAINER Kevin Gilbert

# Update Packages
RUN apt-get -y update

# Install basics
RUN apt-get -y install curl wget make gcc build-essential

# Setup Supervisor
RUN apt-get -y install supervisor
RUN mkdir -p /var/log/supervisor

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

CMD ["/usr/bin/supervisord", "-c /etc/supervisor/conf.d/supervisord.conf"]

这是我在 运行ning 之后在终端中遇到的错误。

remote-testing:analytics-portal kgilbert$ docker run kmgilbert/portal
Error: could not find config file  /etc/supervisor/conf.d/supervisord.conf
For help, use /usr/bin/supervisord -h

尝试使用 CMD:

的 exec 形式
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

或使用 shell 形式

CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

根据基本映像使用的 OS,您甚至可能不必在命令行中指定 supervisord.conf (see this example, or the official documentation)

我在 Alpine linux 3.9 上遇到过,但最终 运行 成功

CMD ["supervisord", "-c", "<path_to_conf_file>"]