docker - getting bundler load error frequently and no such file Gemfile error -
below docker file in project's root directory:-
from ruby:2.2 maintainer technologies.com run apt-get update -qq && apt-get install -y build-essential run apt-get install -y libxml2-dev libxslt1-dev run apt-get install -y libqt4-webkit libqt4-dev xvfb run apt-get install -y nodejs env install_path /as_app run mkdir -p $install_path workdir $install_path copy gemfile gemfile run bundle install copy . . expose 3000 cmd ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
below contents in docker-compose.yml file in project's root directory :-
as_web: build: . environment: - rails_env=development - queue=* - redis_url=redis://redis:6379 volumes: - .:/as_app ports: - 3000:3000 links: - as_mongo - as_redis command: rails server -b 0.0.0.0 as_mongo: image: mongo:latest ports: - "27017:27017" as_redis: image: redis ports: - "6379:6379" as_worker: build: . environment: - queue=* - rails_env=development - redis_url=redis://redis:6379 volumes: - .:/as_app links: - as_mongo - as_redis command: bundle exec rake environment resque:work
docker version 1.11.2, docker-machine version 0.8.0-rc1, docker-compose version 1.8.0-rc1, ruby 2.2.5, rails 4.2.4.
my problem as:-
1) when build image "docker-compose build" project root directory image builds gems installed.
2) when "docker-compose up" as_web , as_worker services exits code 1 , 10 resp. giving error no gemfile or .bundler found. when login in image through bash , see working directory no project files seen.
3) knowledge want know is:-
i) when start terminal, start virtualbox instance manually "docker-machine start default"
ii) execute command "eval $(docker-machine env dev)" point current shell virtualbox docker-daemon, after when "docker build -t as_web ." terminal gives message "sending current build context docker daemon",
a) message saying build in being done in virtualbox ?
if "docker-compose build" no such message "sending...." appears,
b) docker-compose point docker daemon in virtual box or it's being build in localhost(myubuntuos), i'm little bit confused?
hoping guys understood details if need info. let me know, thanking all. happy coding.
docker-compose build
, docker build
both same thing. both use docker engine api build image in virtualbox. output messages little different.
your problem because of this:
volumes: - .:/as_app
you're overriding app directory project directory host. if haven't run bundle install on host, files won't in container when starts.
you can fix running docker-compose run as_app bundle install
Comments
Post a Comment