1- # centos-ruby
1+ # Self-contained Ruby builder image.
22#
3- # This image provide a base for running Ruby based applications. It provides
3+ # You can use this image to produce an application image providing the source
4+ # code:
5+ #
6+ # $ docker run -v $(pwd):/tmp/src openshift/centos-ruby-selfcontained
7+ # <your application is being build>
8+ #
9+ # $ docker commit <id> your_application
10+ #
11+ # Then you can start your application using:
12+ #
13+ # $ docker run -p :9292 your_application
14+ #
15+ #
16+ # This image provides a base for running Ruby based applications. It provides
417# just base Ruby installation using SCL and Ruby application server.
518#
619# If you want to use Bundler with C-extensioned gems or MySQL/PostGresql, you
1225
1326# Pull in important updates and then install ruby193 SCL
1427#
15- RUN yum update --assumeyes && \
28+ RUN yum update --assumeyes --skip-broken && \
1629 yum install --assumeyes centos-release-SCL gettext tar which && \
1730 yum install --assumeyes ruby193 ruby193-ruby-devel \
1831 gcc-c++ automake autoconf curl-devel openssl-devel \
@@ -34,8 +47,7 @@ ADD ./etc /opt/ruby/etc/
3447# maintain backward compatibility
3548#
3649RUN cp -f /opt/ruby/bin/prepare /usr/bin/prepare && \
37- cp -f /opt/ruby/bin/run /usr/bin/run && \
38- cp -f /opt/ruby/bin/save-artifacts /usr/bin/save-artifacts
50+ cp -f /opt/ruby/bin/run /usr/bin/run
3951
4052RUN chown -R ruby:ruby /opt/ruby
4153
@@ -52,13 +64,11 @@ ENV APP_ROOT .
5264ENV HOME /opt/ruby
5365ENV PATH $HOME/bin:$PATH
5466
55- # FIXME: This might be a potential bug in STI where if we keep the USER
56- # instruction here, the resulting application image will fail to run.
67+ # The initial 'start' command will trigger an application build when it runs in
68+ # 'self-contained' builder context. After application is built, then this
69+ # command is replaced in final application image by the 'run' command.
5770#
58- # USER ruby
71+ RUN chown -R ruby:ruby /opt/ruby/bin
5972
60- EXPOSE 9292
61-
62- # Display STI usage when invoked outside STI builder
63- #
64- CMD ["/opt/ruby/bin/usage" ]
73+ USER ruby
74+ ENTRYPOINT ["/opt/ruby/bin/start" ]
0 commit comments