Setting up Ruby along with android in docker

I have an issue while setting up docker container with android and ruby environment to run calabash test. I have this docker file for the android part. Whenever I am editing the docker file to install the latest version of ruby and for calabash just like below code

RUN gem install calabash-android

I am getting error just like

  • Windows Docker Container Sizing and Scale planning
  • Docker, where does the firewall go?
  • How to determine when cmds in docker exec complete
  • can i use boot2docker in production ? CoreOS Vs boot2docker
  • Not able to start any containers
  • How to pass System property to docker containers?
  • /bin/sh: 1: gem: not found
    The command ‘/bin/sh -c gem install calabash-android’ returned a non-zero code: 127

    And after that I have tried

    FROM tracer0tong/android-emulator
    
    FROM ruby:2.3.0
    
    RUN gem install calabash-android
    

    like syntax to check whether it is gonna work and seems like not. Is there any way to install both?

  • How to install dependencies via Composer for Symfony project in Dockerfile?
  • Connect container to local database
  • Cron job can't connect to Docker daemon
  • Production vs Development Docker setup for Node (Express & Mongo) App
  • Apache Mesos's Docker Containerizer
  • How to use docker v1 repository
  • One Solution collect form web for “Setting up Ruby along with android in docker”

    The reason you’re getting an error is that the Android Docker image you’re using does not have Ruby installed (rightly so).
    And this Github issue expains why multiple FROM directives in one Dockerfile is not a good idea.
    IMO your best bet would be to see how Ruby is installed in the Ruby Docker image and copy that over into your Dockerfile that builds off of the Android image. Or vice versa – whichever is less effort.

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