zedtux/ruby-git-ce

View on GitHub
Dockerfile

Summary

Maintainability
Test Coverage
# How to use it
# =============
#
# Visit https://blog.zedroot.org/2015/04/30/using-docker-to-maintain-a-ruby-gem/

# ~~~~ Image base ~~~~
# Base image with the latest Ruby only
FROM ruby:2.5.1-slim
LABEL maintainer="Guillaume Hain zedtux@zedroot.org"

# ~~~~ Set up the environment ~~~~
ENV DEBIAN_FRONTEND noninteractive

RUN mkdir -p /gem/
WORKDIR /gem/
ADD . /gem/

# ~~~~ OS Maintenance & Rails Preparation ~~~~
# Rubygems and Bundler
RUN apt-get update && \
  apt-get install -y git build-essential unzip && \
  touch ~/.gemrc && \
  echo "gem: --no-ri --no-rdoc" >> ~/.gemrc && \
  gem install rubygems-update && \
  update_rubygems && \
  gem install bundler && \
  bundle install && \
  apt-get remove --purge -y build-essential && \
  apt-get autoclean -y && \
  apt-get clean

# Import the gem source code
VOLUME .:/gem/

ENTRYPOINT ["bundle", "exec"]
CMD ["rake", "-T"]