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

  • List files in exited container
  • Connection to MySql in Docker-Container fails with Gradle
  • Running two Mysql docker containers
  • nginx timeout after https proxy to localhost
  • How is the execution order of docker run command' options (such as “-v” )?Which first execute?
  • docker run hello-world still fails, permission denied
  • /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 should I pass sensitive environment variables to Amazon ECS tasks?
  • How to change the default docker registry from docker.io to my private registry
  • Many docker volumes, each for different user (swarm mode)
  • Nightwatch inside Docker only works with Phantom
  • Starting Docker containers from PHP
  • VBoxManage: error: VT-x is disabled in the BIOS for all CPU modes
  • 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.