Build DOCKER image using Openshift S2I

Source-To-Image (S2I), as the name implies, is responsible for transforming your application source into an executable Docker image that we can later run inside of OpenShift v3 or directly via `docker run`.

We can find the main project at github and bunch of sti templates for language specific builds.

We need to get the s2i tool from github release and include in PATH.

[sudhaker@dell-cs24-n2 ~]$ wget
[sudhaker@dell-cs24-n2 ~]$ ll
total 5860
drwxrwxr-x. 2 sudhaker sudhaker    4096 Feb 26 21:04 bin
-rw-rw-r--. 1 sudhaker sudhaker 5992810 Feb 18 13:23 source-to-image-v1.0.5-b731f95-linux-amd64.tar.gz
[sudhaker@dell-cs24-n2 ~]$ cd bin; tar zxf ../source-to-image-*.tar.gz; rm ../source-to-image-*.tar.gz; cd -

And the proceed with cooking docker image from a source repository.

[sudhaker@dell-cs24-n2 ~]$ sudo docker images | grep -v openshift
REPOSITORY                                   TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
[sudhaker@dell-cs24-n2 ~]$ sudo ~/bin/s2i build git:// openshift/nodejs-010-centos7 my-node-app
I0228 19:19:01.037320 01056 clone.go:32] Downloading "git://" ...
I0228 19:19:01.356601 01056 install.go:236] Using "assemble" installed from "image:///usr/libexec/s2i/assemble"
I0228 19:19:01.356684 01056 install.go:236] Using "run" installed from "image:///usr/libexec/s2i/run"
I0228 19:19:01.356740 01056 install.go:236] Using "save-artifacts" installed from "image:///usr/libexec/s2i/save-artifacts"
---> Installing application source
---> Building your Node application from source
E0228 19:19:05.417666 01056 util.go:91] npm info it worked if it ends with ok
E0228 19:19:05.417827 01056 util.go:91] npm info using npm@1.4.28
E0228 19:19:05.417915 01056 util.go:91] npm info using node@v0.10.40
E0228 19:19:05.608556 01056 util.go:91] npm info preinstall my-node-app@0.0.1
E0228 19:19:05.618591 01056 util.go:91] npm info build /opt/app-root/src
E0228 19:19:05.619139 01056 util.go:91] npm info linkStuff my-node-app@0.0.1
E0228 19:19:05.620359 01056 util.go:91] npm info install my-node-app@0.0.1
E0228 19:19:05.622702 01056 util.go:91] npm info postinstall my-node-app@0.0.1
E0228 19:19:05.623821 01056 util.go:91] npm info prepublish my-node-app@0.0.1
E0228 19:19:05.628719 01056 util.go:91] npm info ok
[sudhaker@dell-cs24-n2 bin]$ sudo docker images | grep -v openshift
REPOSITORY                                   TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
my-node-app                                  latest              85901d40c60b        55 seconds ago      438.7 MB

Let’s test this docker image

[sudhaker@dell-cs24-n2 ~]$ sudo docker run --detach --publish 8080:8080 my-node-app
[sudhaker@dell-cs24-n2 ~]$ curl http://localhost:8080/
My Node App v-1.0 !! Server : 92c707e8bedd

My basement data-center


Hardware Setup

  • Biostar NM70I-847 Intel Celeron 847 | my 24×7 file-server, web-server
  • Dell CS24-SC Server | 6 Servers | Each @ Xeon L5420 8 cores 2.5GHz, two servers with 40GB + others 24GB RAM
  • Dell PowerEdge C1100 (CS24-TY) | 1 Server | Xeon X5650 12 cores 2.66GHz, 96GB RAM (added recently)

Networking Setup

  • Verizon Fios @ 50/50 mbps
  • Servers are sitting in outer DMZ (
  • NIC and BMC ports are assigned static IP & hostname
  • Everything is connected through a Gigabit switch

Software Setup

  • Celeron server runs: samba, docker/nginx, docker/gitlab
  • Dell servers are rebuilt frequently using technique mentioned here. CentOS distribution is catched locally using technique mentioned TODO.

And I can control them from my Android phone.