First get a copy of the getting-started app: https://github.com/docker/getting-started-app/tree/main then you need this as Dockerfile: {{{ # Self-contained Ruby builder image. # # You can use this image to produce an application image providing the source # code: # # $ docker run -v $(pwd):/tmp/src openshift/centos-ruby-selfcontained # # # $ docker commit your_application # # Then you can start your application using: # # $ docker run -p :9292 your_application # # # This image provides a base for running Ruby based applications. It provides # just base Ruby installation using SCL and Ruby application server. # # If you want to use Bundler with C-extensioned gems or MySQL/PostGresql, you # can use 'centos-ruby-extended' image instead. # FROM centos:6 MAINTAINER Michal Fojtik ADD ./etc /root/etc ADD ./i686 /root/i686 RUN mv /etc/yum.repos.d /etc/yum.repos.d.orig RUN cp -a /root/etc/yum.repos.d /etc/ RUN cp -f /root/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 /etc/pki/rpm-gpg/ # Pull in important updates and then install ruby193 SCL # RUN yum -y groupinstall "Development tools" "Additional development" RUN yum -y install libstdc++.i686 libstdc++ unixODBC.i686 mysql-libs.i686 mysql-libs libcurl-devel.i686 expat.i686 expat glib2.i686 glib2 freetype.i686 libSM.i686 libXrender.i686 fontconfig.i686 libXext-devel.i686 guacd libguac-client-vnc mysql-server tomcat6 system-config-printer libXext.i686 libXext rxvt mpage unix2dos gtk2-devel gtk2-devel.i686 seamonkey ORBit2-devel mlocate fail2ban libgcj.i686 tcsh RUN yum -y install unixODBC-devel.i686 glibc-devel.i686 openssl-devel.i686 RUN cd /root/i686 RUN yum -y install /root/i686/w3c*.rpm RUN yum -y install mysql-devel.i686 RUN yum -y install libcom_err-devel.i686 krb5-devel.i686 RUN yum -y install libidn-devel.i686 zlib-devel.i686 RUN yum -y install fontconfig-devel.i686 RUN yum -y install qt-devel.i686 RUN yum -y install libxml2-devel.i686 RUN yum -y install vim RUN ln -s /u/cc / RUN ln -s /u/ccr.16 / #This is to build rel 16 #RUN . /u/ccr.16/usr/devlop.sh #RUN /u/ccr.16/script/Getall #RUN /u/ccr.16/script/linux_build #RUN yum -y --allowerasing --skip-broken groupinstall "Additional development" # yum clean all # Create 'ruby' account we will use to run Ruby application # #RUN mkdir -p /opt/ruby/{gems,run,src,bin} && \ # groupadd -r ruby -f -g 433 && \ # useradd -u 431 -r -g ruby -d /opt/ruby -s /sbin/nologin -c "Ruby application" ruby #ADD ./bin /opt/ruby/bin/ #ADD ./etc /opt/ruby/etc/ # FIXME: The STI require all scripts in /usr/bin path, this layer is here to # maintain backward compatibility # #RUN cp -f /opt/ruby/bin/prepare /usr/bin/prepare && \ # cp -f /opt/ruby/bin/run /usr/bin/run #RUN chown -R ruby:ruby /opt/ruby # Set the 'root' directory where this build will search for Gemfile and # config.ru. # # This can be overridden inside another Dockerfile that uses this image as a base # image or in STI via the '-e "APP_ROOT=subdir"' option. # # Use this in case when your application is contained in a subfolder of your # GIT repository. The default value is the root folder. # #ENV APP_ROOT . #ENV HOME /opt/ruby #ENV PATH $HOME/bin:$PATH # The initial 'start' command will trigger an application build when it runs in # 'self-contained' builder context. After application is built, then this # command is replaced in final application image by the 'run' command. # #RUN chown -R ruby:ruby /opt/ruby/bin #USER ruby #ENTRYPOINT ["/opt/ruby/bin/start"] ENTRYPOINT "/u/ccr.16/script/GetAll" #ENTRYPOINT "/u/ccr.16/script/linux_build" #ENTRYPOINT "/u/ccr.16/script/setupenv.sh" }}} Then in the directory where "Dockerfile" is located, {{{ #docker build -t getting-started . }}} Modify Dockerfile last line and uncomment the linux_build: {{{ #ENTRYPOINT "/u/ccr.16/script/GetAll" ENTRYPOINT "/u/ccr.16/script/linux_build }}} Then: {{{ #docker build -t linux-build . }}} Modify Dockerfile last line again, this time comment out all the ENTRYPOINT: {{{ #ENTRYPOINT ["/opt/ruby/bin/start"] #ENTRYPOINT "/u/ccr.16/script/GetAll" #ENTRYPOINT "/u/ccr.16/script/linux_build" #ENTRYPOINT "/u/ccr.16/script/setupenv.sh" }}} Then {{{ #docker build -t shell . }}} There are now 3 images in our repository, all based on CentOS 6 getting-started: gets all the source. linux-build: compiles the linux and x11 version. shell: can be used for an interactive shell. First 2 can be added to cron for nightly compile: {{{ 50 0 * * * docker run -v /u:/u -v /usr/bin/realsccs:/usr/bin/realsccs getting-started 55 0 * * * docker run -v /u:/u -v /usr/bin/realsccs:/usr/bin/realsccs linux-build }}} To get a shell we create a simple shell script so we don't need to remember everything /usr/local/bin/rel16env {{{#!/bin/bash docker run -v /u:/u -v /usr/bin/realsccs:/usr/bin/realsccs -v /tmp:/tmp -it shell bash -rcfile /u/cc/script/setupenv.sh }}} so to get a rel 16 compile environment interactive shell, you just need to run {{{ $rel16env }}}