Compose: Could not locate Gemfile or .bundle/ directory

Created on 11 Dec 2015  路  2Comments  路  Source: docker/compose

I'm not sure if there is anything I'm missing in my configuration. My rails app works on mac and not on windows. It is my understanding that it should just work. yes/no?

- Windows 10
Docker version 1.9.1, build a34a1d5
docker-compose version 1.5.2, build e5cf49d

- mac os x 10.5
Docker version 1.9.1, build a34a1d5
docker-compose version 1.5.2, build 7240ff3

Activity

web_1 | Could not locate Gemfile or .bundle/ directory

Dockerfile

FROM ruby:2.2.3
MAINTAINER Dakota Lightning <[email protected]>
RUN apt-get update -qq && apt-get install -y build-essential nodejs libpq-dev
RUN mkdir -p /var/myapp
WORKDIR /var/myapp
COPY Gemfile /var/myapp/Gemfile
RUN bundle install

docker-compose.yml

web:
  build: .
  volumes:
    - '.:/var/myapp'
  ports:
    - "3000:3000"
  links:
    - db
  command: bundle exec rails s -b '0.0.0.0'
db:
  image: mysql
  ports:
    - "13306:3306"
  environment:
    MYSQL_ROOT_PASSWORD: root

Edit: I have tried docker-compose rm

arevolumes kinquestion

Most helpful comment

I believe the problem is that you're using a host volume:


volumes:
 - '.:/var/myapp'

On your OSX host, you must have the Gemfile or .bundle/ in the working directory.

On the windows app they are missing?

To confirm you can remove the volume and see if it works. If you have the same files on both hosts, could you include an ls of the directory, and a docker inspect of the container on both hosts?

All 2 comments

I believe the problem is that you're using a host volume:


volumes:
 - '.:/var/myapp'

On your OSX host, you must have the Gemfile or .bundle/ in the working directory.

On the windows app they are missing?

To confirm you can remove the volume and see if it works. If you have the same files on both hosts, could you include an ls of the directory, and a docker inspect of the container on both hosts?

Hey thanks for trying to help, I was able to figure it out.

  • I pulled the source again
  • restarted docker-machine

It might have been related to not having the files in my /user/ dir

I moved the files after realizing i wasn't in the /user/ folder, I'm guessing it persisted where I had the old folder and wasn't able to mount the volume.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maltefiala picture maltefiala  路  3Comments

dimsav picture dimsav  路  3Comments

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  路  3Comments

leiblix picture leiblix  路  3Comments

saulshanabrook picture saulshanabrook  路  3Comments