Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dockerfile supervisord cannot find path

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
like image 928
kevingilbert100 Avatar asked Oct 23 '16 04:10

kevingilbert100


People also ask

What is Supervisord in Docker?

Also, supervisor is used when we need to run multiple process within the container. I have seen several examples where a container is started from base image and several service are installed and the container is committed to form a new image, all without supervisor.

Should I use supervisor in Docker?

Docker is a great way to componentize an app along different aspects. But I found that when I still need to start multiple programs in a single container, it is better to use supervisor instead of cron scripts. Use supervisor if: You have multiple processes.


2 Answers

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)

like image 136
VonC Avatar answered Oct 24 '22 09:10

VonC


It happended to me on Alpine linux 3.9, but eventually ran successfully with

CMD ["supervisord", "-c", "<path_to_conf_file>"]
like image 42
Sushilinux Avatar answered Oct 24 '22 08:10

Sushilinux