Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

JRuby 1.7 - CentOS Docker image

This repository contains the sources and
Dockerfile
of the base image for deploying JRuby 1.7 applications as reproducible Docker
images. The resulting images can be run either by Docker
or using STI.

Installation

This image is available as trusted build in Docker Index:

index.docker.io/u/mjelen/jruby-17-centos

You can install it using:

$ docker pull mjelen/jruby-17-centos

Repository organization

  • .sti/bin/

    This folder contains scripts that are run by STI:

    • assemble

      Is used to restore the build artifacts from the previous built (in case of
      'incremental build'), to install the sources into location from where the
      application will be run and prepare the application for deployment (eg.
      installing rubygems using bundler, compiling Rails assets, etc..)

    • run

      This script is responsible for running the application, by using the
      application web server. In case of Ruby, the puma
      server is used, if users put the gem "puma" into Gemfile. If they do not,
      then the application is run by using the rackup command, which should
      honour the application server users provided.

    • save-artifacts

      In order to do an incremental build (iow. re-use the build artifacts
      from an already built image in a new image), this script is responsible for
      archiving those. In this image, this script will archive the
      /opt/src/ruby/bundle and Gemfile.lock.

  • ruby/

    This folder is a skeleton of the $HOME folder, which is set to /opt/ruby.
    It provides a Ruby shebang helper (ruby script) and the usage script,
    which STI uses to print a usage message when you run this image outside STI.
    This folder also provides minimal, production ready configuration for puma
    and also tweaked .bashrc and .gemrc to optimize the installation of ruby
    gems.

Environment variables

  • APP_ROOT (default: '.')

    This variable specifies a relative location to your application inside the
    application GIT repository. In case your application is located in a
    sub-folder, you can set this variable to a ./myapplication.

  • STI_SCRIPTS_URL (default: '.sti/bin')

    This variable specifies the location of directory, where assemble, run and
    save-artifacts scripts are downloaded/copied from. By default the scripts
    in this repository will be used, but users can provide an alternative
    location and run their own scripts.

Contributing

In order to test your changes to this STI image or to the STI scripts, you can
use the test/run script. Before that, you have to build the 'candidate' image:

$ docker build -t mjelen/jruby-17-centos-candidate .

After that you can execute ./test/run. You can also use make test to
automate this.

Usage

Building the sinatra-app-example Ruby 2.0 application..

  1. using standalone STI and running the resulting image by Docker:

    $ sti build git://github.com/mfojtik/sinatra-app-example openshift/ruby-20-centos sinatra-app
    $ docker run -p 9292:9292 sinatra-app
    

Accessing the application:

$ curl 127.0.0.1:9292

Copyright

Released under the Apache License 2.0. See the LICENSE file.

Docker Pull Command
Owner
mjelen
Source Repository

Comments (0)