Docker Community Forums

Share and learn in the Docker community.

Error in using supervisord.conf

(Crissi) #1

I have included the Docker File for your reference

         # Tells the Docker which base image to start.
         FROM node

        # Adds files from the host file system into the Docker container.  
        ADD . /app

        # Sets the current working directory for subsequent instructions
        WORKDIR /app

        RUN npm install
        RUN npm install -g bower
        RUN bower install --allow-root
        RUN npm install -g nodemon

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

       # Define mountable directories.
       VOLUME ["/data/db"]

        #expose a port to allow external access
        EXPOSE 9030 9000

        # Start mean application
       ENTRYPOINT ["/usr/bin/supervisord"] 

I have included supervisord.config file for your reference


          command=/usr/bin/mongod --smallfiles

          command=nodejs /opt/app/server/server.js

On running the above Dockerfile it returns error as follows

         docker: Error response from daemon: invalid header field value "oci runtime error:   container_linux.go:247: starting container process caused \"exec: \\\"/usr/bin/supervisord\\\": stat /usr/bin/supervisord: no such file or directory\"\n"

I have uploaded the meanstack application image in DockerHub for your reference as crissi/airlinetest.

This image is created at DockerHub for my Mean Stack Application.I have included code for starting Mongo Container and App Container in supervisord.conf.

(David Maze) #2

Run two containers. One is a prepackaged MongoDB container; the other is your node.js application. Neither runs supervisord. Use a docker-compose.yml file to specify both of them.

This is a more normal Docker setup; it saves you the trouble of manually installing MongoDB yourself; and it avoids the trouble you’re having setting up supervisord.

That error should be pretty clear.