0

I'm trying to run a Dockerized sinatra app with no database using fig, but I keep getting this error:

$ fig up
Recreating my_web_1...
Cannot start container 93f4a091bd6387bd28d8afb8636d2b14623a08d259fba383e8771fee811061a3:   exec: "bundle": executable file not found in $PATH

Here is the Dockerfile

FROM ubuntu-nginx

MAINTAINER Ben Bithacker ben@bithacker.org

COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock

WORKDIR /app

RUN ["/bin/bash", "-l", "-c", "bundle install"]

ADD config/container/start-server.sh /usr/bin/start-server
RUN chmod +x /usr/bin/start-server

ADD . /app

EXPOSE 9292

 CMD ["/usr/bin/start-server"]

The config/container/start-server.sh looks like this

#!/bin/bash
cd /app
source /etc/profile.d/rvm.sh
bundle exec rackup config.ru

The fig.yml looks like this:

web:
 build: .
 command: bundle exec rackup config.ru
 volumes:
   - .:/app
 ports: 
    - "3000:3000"
  environment:
   - SOME_VAR=adsfasdfgasdfdfd
   - SOME_VAR2=ba2gezcjsdhwzhlz24zurg5ira
User314159
  • 7,733
  • 9
  • 39
  • 63

1 Answers1

1

I think there are a couple problems with this setup. Where is bundler installed? Normally you would apt-get install ruby-bundler and it would always be on your path.

I believe your immediate problem is that you're overriding the CMD from the Dockerfile with the command in the fig.yml. I'm assuming (based on the contents of start-server.sh) that you need the path to be set? You should remove the command line from the fig.yml.

You're also overriding the /app directory in the container with the volumes: .:/app in the fig.yml. You probably also want to remove that line.

dnephin
  • 25,944
  • 9
  • 55
  • 45