Unable to run rails console using Docker Compose

Im quite new to Docker and have started using Docker Compose to run my rails 4 application in development on my OS X 10.10 machine. The rails app works fine but if i try to run the rails console using the command below:

docker-compose run web bundle exec rails console

or

  • How to Run a script at the start of Container in Cloud Containers Engine with Kubernetes
  • docker volume mount directory in windows
  • Command for upgrading docker
  • Artifactory docker Repository overrides released docker artifacts
  • Sublime plugins execute in docker container
  • Docker: Dockerize Tomcat application - Best practise
  • docker-compose run web rails console
    

    I get the following error:

    Could not find CFPropertyList-2.3.1 in any of the sources Run bundle
    install
    to install missing gems.

    I tried doing docker-compose run web bundle install, but i continue to get the same error. What could be the reason behind this ?. Below are my Dockerfile and docker-compose.yml .

    Dockerfile

    FROM ruby:2.2.0
    
    RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs npm nodejs-legacy
    RUN npm install -g phantomjs
    
    RUN mkdir /myapp
    WORKDIR /myapp
    
    ADD Gemfile /myapp/Gemfile
    ADD Gemfile.lock /myapp/Gemfile.lock
    
    RUN bundle install
    ADD . /myapp
    

    docker-compose.yml

    version: '2'
    services:
      db:
        image: postgres
      mailcatcher:
        image: yappabe/mailcatcher
        ports:
          - "1025:1025"
          - "1080:1080"
      web:
        build: .
        command: bundle exec rails s -p 3000 -b '0.0.0.0'
        volumes:
          - .:/myapp
        ports:
          - "3000:3000"
        links:
          - db
          - mailcatcher
    

  • How can I use a local image as the base image with a dockerfile?
  • How to make other microservices aware of the IP address of the consul for service registry
  • haproxy / docker No enabled listener found (check for 'bind' directives) ! Exiting
  • deepstream.io docker run error on OSX
  • Dockerized Jenkins and Sonarqube - Link to analysis in project incorrect
  • Docker GELF logging additional fields
  • One Solution collect form web for “Unable to run rails console using Docker Compose”

    to access to rails console you need the docker command, not docker-compose.
    first run

    docker ps
    

    to find the CONTAINER ID (for example 916703608c5e), then run docker exec with that container id:

    docker exec -ti 916703608c5e gitlab-rails console production
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.