Docker image building – a time consuming process

While I have to use the following construct to ensure that the Ruby environment is setup for building gems, and it’s a recommended practice for Docker,

RUN /bin/bash -c "source /usr/local/rvm/scripts/rvm \
 && gem update --system --no-rdoc --no-ri \
 && gem update --no-rdoc --no-ri \
 && gem install --no-rdoc --no-ri bundler \
 && gem install --no-rdoc --no-ri libv8 \
 && gem install --no-rdoc --no-ri mysql2"

One implication of this is that it is an atomic operation and when you discover that the libmysqlclient-dev package is missing and the build needs to be run again, there’s no cache to fall back on. Ruby takes 5 hours on an r-pi, libv8 is 2 hours. This is not quick turnaround stuff for the background build although it will really improve Rails container deployment times. Always a tradeoff.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s