Shiva
Shiva

Reputation: 12514

Ruby On Rails : DOcker : Is it feasible to build ROR project dependencies inside docker image

I work on a project built on ROR. This projects has dependent gems and packages such as Fog, rmagick, sidekiq, elasticsearch, carrierwave, imagemagic, engineyard, ruby, rails, etc.

Problems we faced:
Frequently laptops of my fellow developers crash. It takes the whole working-day to install all the dependent gems and packages in linux Ubuntu 14.04 / 15.04.

Upvotes: 2

Views: 164

Answers (2)

wpp
wpp

Reputation: 7303

Is it possible to build everything I mentioned above inside a docker image and distribute among the developers?

Yes! I'm running a couple of Rails applications in Docker containers. Apart from Mark O'Connor's link I suggest you check out:

This is a demo app I created show how to develop and deploy a moderately complex application with docker.

  1. https://github.com/cpuguy83/docker-rails-dev-demo

Or (more advanced)

  1. https://github.com/discourse/discourse_docker

These are examples of how you can build a Rails image. As far as distributing goes: You'll probably have to setup your own Docker Registry or in case you don't mind having the images in out in the open push it to the docker.io registry.

Can we run rails like rails s?

Yes you can think of a docker container as an execution environment for your rails application. All your typical commands can be run.

Upvotes: 1

Mark O'Connor
Mark O'Connor

Reputation: 77931

I suggest checking out the official rails image from Docker

https://registry.hub.docker.com/_/rails/

This will still download dependencies but you could adapt it to build a base container that already includes the dependencies.

Upvotes: 1

Related Questions