Dockerfile – how to run script?

Created a docker file, but unable to get run the rail setup script i.e ./bin/setup to execute

What am I doing wrong? RUN /bin/bash -C "/usr/src/app/bin/setup" this does not work.

  • Error with running simple Elixir app in Docker container
  • High Availability for Bluemix Secure Gateway Docker Client
  • Is it safe to extract the root filesystem of a image and use it in a chroot?
  • Nginx content caching causing Docker memory spike
  • LINKERD: Unable to build docker image from linkerd
  • Application folder is not copied into the Docker image
  • I also tried this RUN ./bin/setup (this also does not work!)


    FROM ruby:2.3
    RUN apt-get update && apt-get install -y nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/*
    RUN gem install rails --version "$RAILS_VERSION"
    WORKDIR /usr/src/app
    COPY . .
    # setup does not run, why?
    RUN /bin/bash -C "/usr/src/app/bin/setup"

  • ECS Showing Error After Running Task Definition “STOPPED (Essential container in task exited)”
  • How to configure Vagrant box filesystem?
  • docker-compose start “ERROR: No containers to start”
  • Debugging Unicorn server remotely with RubyMine
  • how can we make volume as optional in docker compose .yml , how can we mount volume as optional using flag
  • Docker using separate lib/bin
  • One Solution collect form web for “Dockerfile – how to run script?”

    I was facing a similar dos/unix issue. I did a git check out of a file in windows and added it to docker image(linux). If that is the case sed is your friend. Just add following to your Dockerfile:

    RUN /bin/sed s/\\r//g -i /usr/src/app/bin/setup

    Might save you from installing an additional package. Hope it help!

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.