Dockerfile supervisord cannot find path

docker, supervisord

Solution

Try with the exec form of `CMD`:

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

or with the shell form

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

Depending on the OS used by the base image, you might not even have to specify the `supervisord.conf` in the command line (see this example, or the official documentation)

Problem

For some reason supervisord cannot start up when executing docker run... If I log out the path where the configuration is stored for supervisord I can clearly see that the file is present. Below is the part of my Dockerfile thats not currently commented out. ``` 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"] ``` Here is the error I get in terminal after running. ``` 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 ```

Original source