How to Build Your Own Openshift Builder Image (PHP 5.6 with oci, pdo_oci, rfc) - part II

In the previous post, I described the final process of building an Openshift builder docker image. This post is like a flashback - where I describe the processes before  the final docker image can be built.
The processes are necessary to build two files; the pdo-oci rpm (rh-php56-php-pdo_oci-5.6.25-1.el7.centos.x86_64.rpm) and the oci8.so extension file.

Checkout

Let us checkout the pdo_oci8 branch first from (my) github : (skip if you already followed part I)
aws@broker ~ $ git clone https://github.com/yudhiwidyatama/s2i-php-container.git
aws@broker ~ $ cd s2i-php-container/
aws@broker s2i-php-container $ git checkout pdo_oci8
Branch pdo_oci8 set up to track remote branch pdo_oci8 from origin.
Switched to a new branch 'pdo_oci8'

Go to the 5.6 php version directory :


aws@broker s2i-php-container $ ls
5.5  5.6  7.0  7.1  common  LICENSE  Makefile  README.md
aws@broker s2i-php-container $ cd 5.6
aws@broker 5.6 $ ls -l
total 24716
-rw-rw-r--. 1 aws aws      112 Nov 20 14:30 cccp.yml
-rw-rw-r--. 1 aws aws     3623 Mar 28 20:36 Dockerfile
-rw-rw-r--. 1 aws aws     3184 Mar 28 20:36 Dockerfile.rhel7
-rw-rw-r--. 1 aws aws     2087 Mar 28 20:36 Dockerfile.stage1
-rw-rw-r--. 1 aws aws     2947 Mar 28 20:36 Dockerfile.stage2
-rw-rw-r--. 1 aws aws     2873 Mar 28 20:36 Dockerfile.stage3
-rw-rw-r--. 1 aws aws     3589 Mar 28 20:36 Dockerfile.stage4min
-rw-rw-r--. 1 aws aws   576120 Mar 28 20:36 oci8.so
-rw-rw-r--. 1 aws aws    92980 Mar 28 20:36 php.spec
-rw-rw-r--. 1 aws aws     6879 Mar 28 20:36 README.md
-rw-rw-r--. 1 aws aws 24322441 Nov 29 07:48 rfcsdk.tar.gz
-rw-rw-r--. 1 aws aws    47984 Mar 28 20:36 rh-php56-php-pdo_oci-5.6.25-1.el7.centos.x86_64.rpm
drwxrwxr-x. 4 aws aws     4096 Mar 28 20:36 root
drwxrwxr-x. 3 aws aws     4096 Nov 20 14:30 s2i
-rw-rw-r--. 1 aws aws   210104 Nov 29 07:48 saprfc.tar.gz
drwxrwxr-x. 3 aws aws     4096 Mar 28 20:36 test


We have Dockerfile for stage1,stage2, stage3 and stage4min.
The purpose of stage1 is to prepare base image for stage2 and stage3.
The stage2's purpose is to create pdo_oci8 rpm, and stage3 is to prepare create oci8.so.

Preparation 

Please ensure the centos base image are up-to-date.


aws@broker 5.6 $ docker pull centos/s2i-base-centos7
latest: Pulling from centos/s2i-base-centos7
28b0a3c5ee4c: Pull complete 
1f2965b8bcc4: Pull complete 
d5e8864a9881: Pull complete 
038d5dbe0fc5: Pull complete 
7d08112f59e8: Pull complete 
af124b8fb0b8: Pull complete 
bd3cf27801f8: Pull complete 
40f85a17a5d8: Pull complete 
14db5037ed83: Pull complete 
d40cd7dcf2b0: Pull complete 
bb4f537a6349: Pull complete 
c123b367e221: Pull complete 
7f36614f2297: Pull complete 
bdd505fa3756: Pull complete 
bed782a275ce: Pull complete 
912543b1b0fb: Pull complete 
1b165c5ac84d: Pull complete 
02cf7c504a28: Pull complete 
Digest: sha256:2ae5946a7d35ec324778baac86eb87538dac135e46e98c6da67ccd433a40782c
Status: Downloaded newer image for centos/s2i-base-centos7:latest

Stage1

In this first stage we build a baseline docker image with the required php56 packages. 
Note: if the rh-php56-php packages not found, please pull the latest pdo_oci8 from github project s2i-php-container because the packages were just recently moved to vault so needing an additional repo file (see Step 6 below). And you could change the git hub user prefix tag, but also remember to change the first line in the next stage files.


aws@broker 5.6 $ docker build -f Dockerfile.stage1 -t yudhiwidyatama/s2i-php56-oci8-stage1 .
Sending build context to Docker daemon 89.48 MB
Sending build context to Docker daemon 
Step 0 : FROM centos/s2i-base-centos7
 ---> 02cf7c504a28
Step 1 : EXPOSE 8080
 ---> Using cache
 ---> 0704834d55c5
Step 2 : EXPOSE 8443
 ---> Running in c320d3fc0750
 ---> 855ee9806db5
Removing intermediate container c320d3fc0750
Step 3 : ENV PHP_VERSION 5.6 PATH $PATH:/opt/rh/rh-php56/root/usr/bin
 ---> Running in f11d106d4cf3
 ---> b536c07632d5
Removing intermediate container f11d106d4cf3
Step 4 : ENV SUMMARY "Platform for building and running PHP $PHP_VERSION applications" DESCRIPTION "PHP $PHP_VERSION available as docker container is a base platform for building and running various PHP $PHP_VERSION applications and frameworks. PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers to write dynamically generated web pages. PHP also offers built-in database integration for several commercial and non-commercial database management systems, so writing a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding is probably as a replacement for CGI scripts."
 ---> Running in 4ad14576a47f
 ---> 2b49e0cfbba8
Removing intermediate container 4ad14576a47f
Step 5 : LABEL summary "$SUMMARY" description "$DESCRIPTION" io.k8s.description "$DESCRIPTION" io.k8s.display-name "Apache 2.4 with PHP 5.6" io.openshift.expose-services "8080:http" io.openshift.tags "builder,php,php56,rh-php56" name "centos/php-56-centos7" com.redhat.component "rh-php56-docker" version "5.6" release "1" maintainer "SoftwareCollections.org "
 ---> Running in d3879d6e25ca
 ---> e8ec6ee45349
Removing intermediate container d3879d6e25ca
Step 6 : COPY ./VaultRh.repo /etc/yum.repos.d/VaultRh.repo
 ---> d1e45c3082ff
Removing intermediate container 1d6dad140b74
Step 7 : RUN yum install -y centos-release-scl &&     INSTALL_PKGS="rh-php56 rh-php56-php rh-php56-php-mysqlnd rh-php56-php-pgsql rh-php56-php-bcmath                   rh-php56-php-gd rh-php56-php-intl rh-php56-php-ldap rh-php56-php-mbstring rh-php56-php-pdo                   rh-php56-php-pecl-memcache rh-php56-php-process rh-php56-php-soap rh-php56-php-opcache rh-php56-php-xml                   rh-php56-php-pecl-xdebug rh-php56-php-gmp rh-php56-php-devel" &&     yum install -y --setopt=tsflags=nodocs --enablerepo=centosplus --enablerepo=vaultrh $INSTALL_PKGS &&     rpm -V $INSTALL_PKGS &&     yum clean all -y
 ---> Running in d3cd88f1e6b8
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
 * base: mirror.buana.web.id
 * extras: mirror.buana.web.id
 * updates: mirror.buana.web.id
Package centos-release-scl-2-2.el7.centos.noarch already installed and latest version
Nothing to do
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: mirror.buana.web.id
 * centosplus: mirror.buana.web.id
 * extras: mirror.buana.web.id
 * updates: mirror.buana.web.id
Resolving Dependencies
--> Running transaction check
---> Package rh-php56.x86_64 0:2.3-1.el7 will be installed
--> Processing Dependency: rh-php56-runtime(x86-64) = 2.3-1.el7 for package: rh-php56-2.3-1.el7.x86_64
--> Processing Dependency: rh-php56-runtime for package: rh-php56-2.3-1.el7.x86_64
--> Processing Dependency: rh-php56-php-pear for package: rh-php56-2.3-1.el7.x86_64
--> Processing Dependency: rh-php56-php-common(x86-64) for package: rh-php56-2.3-1.el7.x86_64
--> Processing Dependency: rh-php56-php-cli(x86-64) for package: rh-php56-2.3-1.el7.x86_64
---> Package rh-php56-php.x86_64 0:5.6.25-1.el7 will be installed
--> Processing Dependency: httpd24-httpd-mmn = 20120211x8664 for package: rh-php56-php-5.6.25-1.el7.x86_64
--> Processing Dependency: httpd24-httpd for package: rh-php56-php-5.6.25-1.el7.x86_64
---> Package rh-php56-php-bcmath.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-devel.x86_64 0:5.6.25-1.el7 will be installed
--> Processing Dependency: rh-php56-php-pecl-jsonc-devel(x86-64) for package: rh-php56-php-devel-5.6.25-1.el7.x86_64
---> Package rh-php56-php-gd.x86_64 0:5.6.25-1.el7 will be installed
--> Processing Dependency: libvpx.so.1()(64bit) for package: rh-php56-php-gd-5.6.25-1.el7.x86_64
--> Processing Dependency: libt1.so.5()(64bit) for package: rh-php56-php-gd-5.6.25-1.el7.x86_64
---> Package rh-php56-php-gmp.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-intl.x86_64 0:5.6.25-1.el7 will be installed
--> Processing Dependency: libicuuc.so.50()(64bit) for package: rh-php56-php-intl-5.6.25-1.el7.x86_64
--> Processing Dependency: libicuio.so.50()(64bit) for package: rh-php56-php-intl-5.6.25-1.el7.x86_64
--> Processing Dependency: libicui18n.so.50()(64bit) for package: rh-php56-php-intl-5.6.25-1.el7.x86_64
--> Processing Dependency: libicudata.so.50()(64bit) for package: rh-php56-php-intl-5.6.25-1.el7.x86_64
---> Package rh-php56-php-ldap.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-mbstring.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-mysqlnd.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-opcache.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-pdo.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-pecl-memcache.x86_64 0:3.0.8-12.el7 will be installed
---> Package rh-php56-php-pecl-xdebug.x86_64 0:2.2.7-3.el7 will be installed
---> Package rh-php56-php-pgsql.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-process.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-soap.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-xml.x86_64 0:5.6.25-1.el7 will be installed
--> Running transaction check
---> Package httpd24-httpd.x86_64 0:2.4.34-7.el7 will be installed
--> Processing Dependency: httpd24-httpd-tools = 2.4.34-7.el7 for package: httpd24-httpd-2.4.34-7.el7.x86_64
--> Processing Dependency: system-logos >= 7.92.1-1 for package: httpd24-httpd-2.4.34-7.el7.x86_64
--> Processing Dependency: policycoreutils-python for package: httpd24-httpd-2.4.34-7.el7.x86_64
--> Processing Dependency: policycoreutils for package: httpd24-httpd-2.4.34-7.el7.x86_64
--> Processing Dependency: httpd24-runtime for package: httpd24-httpd-2.4.34-7.el7.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd24-httpd-2.4.34-7.el7.x86_64
--> Processing Dependency: libnghttp2-httpd24.so.14()(64bit) for package: httpd24-httpd-2.4.34-7.el7.x86_64
--> Processing Dependency: libjansson.so.4()(64bit) for package: httpd24-httpd-2.4.34-7.el7.x86_64
--> Processing Dependency: libcurl-httpd24.so.4()(64bit) for package: httpd24-httpd-2.4.34-7.el7.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd24-httpd-2.4.34-7.el7.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd24-httpd-2.4.34-7.el7.x86_64
---> Package libicu.x86_64 0:50.1.2-17.el7 will be installed
---> Package libvpx.x86_64 0:1.3.0-5.el7_0 will be installed
---> Package rh-php56-php-cli.x86_64 0:5.6.25-1.el7 will be installed
---> Package rh-php56-php-common.x86_64 0:5.6.25-1.el7 will be installed
--> Processing Dependency: rh-php56-php-pecl-jsonc(x86-64) for package: rh-php56-php-common-5.6.25-1.el7.x86_64
---> Package rh-php56-php-pear.noarch 1:1.9.5-4.el7 will be installed
---> Package rh-php56-php-pecl-jsonc-devel.x86_64 0:1.3.6-3.el7 will be installed
---> Package rh-php56-runtime.x86_64 0:2.3-1.el7 will be installed
--> Processing Dependency: libselinux-utils for package: rh-php56-runtime-2.3-1.el7.x86_64
---> Package t1lib.x86_64 0:5.1.2-14.el7 will be installed
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-3.el7_4.1 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package centos-logos.noarch 0:70.0.6-3.el7.centos will be installed
---> Package httpd24-httpd-tools.x86_64 0:2.4.34-7.el7 will be installed
---> Package httpd24-libcurl.x86_64 0:7.61.1-1.el7 will be installed
---> Package httpd24-libnghttp2.x86_64 0:1.7.1-7.el7 will be installed
---> Package httpd24-runtime.x86_64 0:1.1-18.el7 will be installed
---> Package jansson.x86_64 0:2.10-1.el7 will be installed
---> Package libselinux-utils.x86_64 0:2.5-14.1.el7 will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
---> Package policycoreutils.x86_64 0:2.5-29.el7_6.1 will be installed
---> Package policycoreutils-python.x86_64 0:2.5-29.el7_6.1 will be installed
--> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: libsemanage-python >= 2.5-14 for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: libselinux-python for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: libcgroup for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64
---> Package rh-php56-php-pecl-jsonc.x86_64 0:1.3.6-3.el7 will be installed
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.8.4-4.el7 will be installed
---> Package checkpolicy.x86_64 0:2.5-8.el7 will be installed
---> Package libcgroup.x86_64 0:0.41-20.el7 will be installed
---> Package libselinux-python.x86_64 0:2.5-14.1.el7 will be installed
---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be installed
---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                       Arch   Version              Repository      Size
================================================================================
Installing:
 rh-php56                      x86_64 2.3-1.el7            vaultrh        4.0 k
 rh-php56-php                  x86_64 5.6.25-1.el7         vaultrh        1.3 M
 rh-php56-php-bcmath           x86_64 5.6.25-1.el7         vaultrh         59 k
 rh-php56-php-devel            x86_64 5.6.25-1.el7         vaultrh        629 k
 rh-php56-php-gd               x86_64 5.6.25-1.el7         vaultrh        158 k
 rh-php56-php-gmp              x86_64 5.6.25-1.el7         vaultrh         56 k
 rh-php56-php-intl             x86_64 5.6.25-1.el7         vaultrh        150 k
 rh-php56-php-ldap             x86_64 5.6.25-1.el7         vaultrh         57 k
 rh-php56-php-mbstring         x86_64 5.6.25-1.el7         vaultrh        519 k
 rh-php56-php-mysqlnd          x86_64 5.6.25-1.el7         vaultrh        185 k
 rh-php56-php-opcache          x86_64 5.6.25-1.el7         vaultrh        101 k
 rh-php56-php-pdo              x86_64 5.6.25-1.el7         vaultrh        100 k
 rh-php56-php-pecl-memcache    x86_64 3.0.8-12.el7         vaultrh         69 k
 rh-php56-php-pecl-xdebug      x86_64 2.2.7-3.el7          vaultrh        122 k
 rh-php56-php-pgsql            x86_64 5.6.25-1.el7         vaultrh         95 k
 rh-php56-php-process          x86_64 5.6.25-1.el7         vaultrh         61 k
 rh-php56-php-soap             x86_64 5.6.25-1.el7         vaultrh        165 k
 rh-php56-php-xml              x86_64 5.6.25-1.el7         vaultrh        162 k
Installing for dependencies:
 apr                           x86_64 1.4.8-3.el7_4.1      base           103 k
 apr-util                      x86_64 1.5.2-6.el7          base            92 k
 audit-libs-python             x86_64 2.8.4-4.el7          base            76 k
 centos-logos                  noarch 70.0.6-3.el7.centos  base            21 M
 checkpolicy                   x86_64 2.5-8.el7            base           295 k
 httpd24-httpd                 x86_64 2.4.34-7.el7         centos-sclo-rh 1.5 M
 httpd24-httpd-tools           x86_64 2.4.34-7.el7         centos-sclo-rh  88 k
 httpd24-libcurl               x86_64 7.61.1-1.el7         centos-sclo-rh 268 k
 httpd24-libnghttp2            x86_64 1.7.1-7.el7          centos-sclo-rh  61 k
 httpd24-runtime               x86_64 1.1-18.el7           centos-sclo-rh  28 k
 jansson                       x86_64 2.10-1.el7           base            37 k
 libcgroup                     x86_64 0.41-20.el7          base            66 k
 libicu                        x86_64 50.1.2-17.el7        base           6.9 M
 libselinux-python             x86_64 2.5-14.1.el7         base           235 k
 libselinux-utils              x86_64 2.5-14.1.el7         base           151 k
 libsemanage-python            x86_64 2.5-14.el7           base           113 k
 libvpx                        x86_64 1.3.0-5.el7_0        base           498 k
 mailcap                       noarch 2.1.41-2.el7         base            31 k
 policycoreutils               x86_64 2.5-29.el7_6.1       updates        916 k
 policycoreutils-python        x86_64 2.5-29.el7_6.1       updates        456 k
 python-IPy                    noarch 0.75-6.el7           base            32 k
 rh-php56-php-cli              x86_64 5.6.25-1.el7         vaultrh        2.6 M
 rh-php56-php-common           x86_64 5.6.25-1.el7         vaultrh        742 k
 rh-php56-php-pear             noarch 1:1.9.5-4.el7        vaultrh        367 k
 rh-php56-php-pecl-jsonc       x86_64 1.3.6-3.el7          vaultrh         44 k
 rh-php56-php-pecl-jsonc-devel x86_64 1.3.6-3.el7          vaultrh         27 k
 rh-php56-runtime              x86_64 2.3-1.el7            vaultrh        1.1 M
 setools-libs                  x86_64 3.3.8-4.el7          base           620 k
 t1lib                         x86_64 5.1.2-14.el7         base           166 k

Transaction Summary
================================================================================
Install  18 Packages (+29 Dependent packages)

Total download size: 43 M
Installed size: 93 M
Downloading packages:
--------------------------------------------------------------------------------
Total                                              1.6 MB/s |  43 MB  00:27     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : apr-1.4.8-3.el7_4.1.x86_64                                  1/47 
  Installing : apr-util-1.5.2-6.el7.x86_64                                 2/47 
  Installing : libselinux-utils-2.5-14.1.el7.x86_64                        3/47 
  Installing : policycoreutils-2.5-29.el7_6.1.x86_64                       4/47 
  Installing : libvpx-1.3.0-5.el7_0.x86_64                                 5/47 
  Installing : libcgroup-0.41-20.el7.x86_64                                6/47 
  Installing : audit-libs-python-2.8.4-4.el7.x86_64                        7/47 
  Installing : libselinux-python-2.5-14.1.el7.x86_64                       8/47 
  Installing : libsemanage-python-2.5-14.el7.x86_64                        9/47 
  Installing : libicu-50.1.2-17.el7.x86_64                                10/47 
  Installing : t1lib-5.1.2-14.el7.x86_64                                  11/47 
  Installing : setools-libs-3.3.8-4.el7.x86_64                            12/47 
  Installing : centos-logos-70.0.6-3.el7.centos.noarch                    13/47 
  Installing : python-IPy-0.75-6.el7.noarch                               14/47 
  Installing : checkpolicy-2.5-8.el7.x86_64                               15/47 
  Installing : policycoreutils-python-2.5-29.el7_6.1.x86_64               16/47 
  Installing : rh-php56-runtime-2.3-1.el7.x86_64                          17/47 
  Installing : httpd24-runtime-1.1-18.el7.x86_64                          18/47 
  Installing : rh-php56-php-pecl-jsonc-1.3.6-3.el7.x86_64                 19/47 
  Installing : rh-php56-php-common-5.6.25-1.el7.x86_64                    20/47 
  Installing : rh-php56-php-cli-5.6.25-1.el7.x86_64                       21/47 
  Installing : rh-php56-php-pdo-5.6.25-1.el7.x86_64                       22/47 
  Installing : rh-php56-php-pecl-jsonc-devel-1.3.6-3.el7.x86_64           23/47 
  Installing : rh-php56-php-devel-5.6.25-1.el7.x86_64                     24/47 
  Installing : rh-php56-php-process-5.6.25-1.el7.x86_64                   25/47 
  Installing : rh-php56-php-xml-5.6.25-1.el7.x86_64                       26/47 
  Installing : 1:rh-php56-php-pear-1.9.5-4.el7.noarch                     27/47 
  Installing : httpd24-libcurl-7.61.1-1.el7.x86_64                        28/47 
  Installing : httpd24-libnghttp2-1.7.1-7.el7.x86_64                      29/47 
  Installing : httpd24-httpd-tools-2.4.34-7.el7.x86_64                    30/47 
  Installing : mailcap-2.1.41-2.el7.noarch                                31/47 
  Installing : jansson-2.10-1.el7.x86_64                                  32/47 
  Installing : httpd24-httpd-2.4.34-7.el7.x86_64                          33/47 
  Installing : rh-php56-php-5.6.25-1.el7.x86_64                           34/47 
  Installing : rh-php56-2.3-1.el7.x86_64                                  35/47 
  Installing : rh-php56-php-pgsql-5.6.25-1.el7.x86_64                     36/47 
  Installing : rh-php56-php-mysqlnd-5.6.25-1.el7.x86_64                   37/47 
  Installing : rh-php56-php-soap-5.6.25-1.el7.x86_64                      38/47 
  Installing : rh-php56-php-intl-5.6.25-1.el7.x86_64                      39/47 
  Installing : rh-php56-php-pecl-xdebug-2.2.7-3.el7.x86_64                40/47 
  Installing : rh-php56-php-pecl-memcache-3.0.8-12.el7.x86_64             41/47 
  Installing : rh-php56-php-opcache-5.6.25-1.el7.x86_64                   42/47 
  Installing : rh-php56-php-mbstring-5.6.25-1.el7.x86_64                  43/47 
  Installing : rh-php56-php-ldap-5.6.25-1.el7.x86_64                      44/47 
  Installing : rh-php56-php-gmp-5.6.25-1.el7.x86_64                       45/47 
  Installing : rh-php56-php-bcmath-5.6.25-1.el7.x86_64                    46/47 
  Installing : rh-php56-php-gd-5.6.25-1.el7.x86_64                        47/47 
  Verifying  : rh-php56-php-5.6.25-1.el7.x86_64                            1/47 
  Verifying  : rh-php56-php-devel-5.6.25-1.el7.x86_64                      2/47 
  Verifying  : jansson-2.10-1.el7.x86_64                                   3/47 
  Verifying  : mailcap-2.1.41-2.el7.noarch                                 4/47 
  Verifying  : httpd24-libcurl-7.61.1-1.el7.x86_64                         5/47 
  Verifying  : rh-php56-php-soap-5.6.25-1.el7.x86_64                       6/47 
  Verifying  : rh-php56-php-intl-5.6.25-1.el7.x86_64                       7/47 
  Verifying  : policycoreutils-2.5-29.el7_6.1.x86_64                       8/47 
  Verifying  : rh-php56-php-pecl-xdebug-2.2.7-3.el7.x86_64                 9/47 
  Verifying  : 1:rh-php56-php-pear-1.9.5-4.el7.noarch                     10/47 
  Verifying  : rh-php56-php-cli-5.6.25-1.el7.x86_64                       11/47 
  Verifying  : rh-php56-php-pecl-memcache-3.0.8-12.el7.x86_64             12/47 
  Verifying  : rh-php56-runtime-2.3-1.el7.x86_64                          13/47 
  Verifying  : checkpolicy-2.5-8.el7.x86_64                               14/47 
  Verifying  : httpd24-httpd-tools-2.4.34-7.el7.x86_64                    15/47 
  Verifying  : rh-php56-php-pecl-jsonc-devel-1.3.6-3.el7.x86_64           16/47 
  Verifying  : httpd24-runtime-1.1-18.el7.x86_64                          17/47 
  Verifying  : rh-php56-php-opcache-5.6.25-1.el7.x86_64                   18/47 
  Verifying  : python-IPy-0.75-6.el7.noarch                               19/47 
  Verifying  : httpd24-libnghttp2-1.7.1-7.el7.x86_64                      20/47 
  Verifying  : centos-logos-70.0.6-3.el7.centos.noarch                    21/47 
  Verifying  : rh-php56-php-mbstring-5.6.25-1.el7.x86_64                  22/47 
  Verifying  : rh-php56-php-ldap-5.6.25-1.el7.x86_64                      23/47 
  Verifying  : httpd24-httpd-2.4.34-7.el7.x86_64                          24/47 
  Verifying  : setools-libs-3.3.8-4.el7.x86_64                            25/47 
  Verifying  : policycoreutils-python-2.5-29.el7_6.1.x86_64               26/47 
  Verifying  : t1lib-5.1.2-14.el7.x86_64                                  27/47 
  Verifying  : libicu-50.1.2-17.el7.x86_64                                28/47 
  Verifying  : libsemanage-python-2.5-14.el7.x86_64                       29/47 
  Verifying  : apr-util-1.5.2-6.el7.x86_64                                30/47 
  Verifying  : rh-php56-php-gmp-5.6.25-1.el7.x86_64                       31/47 
  Verifying  : rh-php56-php-pgsql-5.6.25-1.el7.x86_64                     32/47 
  Verifying  : apr-1.4.8-3.el7_4.1.x86_64                                 33/47 
  Verifying  : libselinux-python-2.5-14.1.el7.x86_64                      34/47 
  Verifying  : rh-php56-php-mysqlnd-5.6.25-1.el7.x86_64                   35/47 
  Verifying  : rh-php56-php-pdo-5.6.25-1.el7.x86_64                       36/47 
  Verifying  : rh-php56-php-bcmath-5.6.25-1.el7.x86_64                    37/47 
  Verifying  : libselinux-utils-2.5-14.1.el7.x86_64                       38/47 
  Verifying  : audit-libs-python-2.8.4-4.el7.x86_64                       39/47 
  Verifying  : rh-php56-php-process-5.6.25-1.el7.x86_64                   40/47 
  Verifying  : rh-php56-php-pecl-jsonc-1.3.6-3.el7.x86_64                 41/47 
  Verifying  : rh-php56-php-xml-5.6.25-1.el7.x86_64                       42/47 
  Verifying  : libcgroup-0.41-20.el7.x86_64                               43/47 
  Verifying  : rh-php56-php-gd-5.6.25-1.el7.x86_64                        44/47 
  Verifying  : libvpx-1.3.0-5.el7_0.x86_64                                45/47 
  Verifying  : rh-php56-php-common-5.6.25-1.el7.x86_64                    46/47 
  Verifying  : rh-php56-2.3-1.el7.x86_64                                  47/47 

Installed:
  rh-php56.x86_64 0:2.3-1.el7                                                   
  rh-php56-php.x86_64 0:5.6.25-1.el7                                            
  rh-php56-php-bcmath.x86_64 0:5.6.25-1.el7                                     
  rh-php56-php-devel.x86_64 0:5.6.25-1.el7                                      
  rh-php56-php-gd.x86_64 0:5.6.25-1.el7                                         
  rh-php56-php-gmp.x86_64 0:5.6.25-1.el7                                        
  rh-php56-php-intl.x86_64 0:5.6.25-1.el7                                       
  rh-php56-php-ldap.x86_64 0:5.6.25-1.el7                                       
  rh-php56-php-mbstring.x86_64 0:5.6.25-1.el7                                   
  rh-php56-php-mysqlnd.x86_64 0:5.6.25-1.el7                                    
  rh-php56-php-opcache.x86_64 0:5.6.25-1.el7                                    
  rh-php56-php-pdo.x86_64 0:5.6.25-1.el7                                        
  rh-php56-php-pecl-memcache.x86_64 0:3.0.8-12.el7                              
  rh-php56-php-pecl-xdebug.x86_64 0:2.2.7-3.el7                                 
  rh-php56-php-pgsql.x86_64 0:5.6.25-1.el7                                      
  rh-php56-php-process.x86_64 0:5.6.25-1.el7                                    
  rh-php56-php-soap.x86_64 0:5.6.25-1.el7                                       
  rh-php56-php-xml.x86_64 0:5.6.25-1.el7                                        

Dependency Installed:
  apr.x86_64 0:1.4.8-3.el7_4.1                                                  
  apr-util.x86_64 0:1.5.2-6.el7                                                 
  audit-libs-python.x86_64 0:2.8.4-4.el7                                        
  centos-logos.noarch 0:70.0.6-3.el7.centos                                     
  checkpolicy.x86_64 0:2.5-8.el7                                                
  httpd24-httpd.x86_64 0:2.4.34-7.el7                                           
  httpd24-httpd-tools.x86_64 0:2.4.34-7.el7                                     
  httpd24-libcurl.x86_64 0:7.61.1-1.el7                                         
  httpd24-libnghttp2.x86_64 0:1.7.1-7.el7                                       
  httpd24-runtime.x86_64 0:1.1-18.el7                                           
  jansson.x86_64 0:2.10-1.el7                                                   
  libcgroup.x86_64 0:0.41-20.el7                                                
  libicu.x86_64 0:50.1.2-17.el7                                                 
  libselinux-python.x86_64 0:2.5-14.1.el7                                       
  libselinux-utils.x86_64 0:2.5-14.1.el7                                        
  libsemanage-python.x86_64 0:2.5-14.el7                                        
  libvpx.x86_64 0:1.3.0-5.el7_0                                                 
  mailcap.noarch 0:2.1.41-2.el7                                                 
  policycoreutils.x86_64 0:2.5-29.el7_6.1                                       
  policycoreutils-python.x86_64 0:2.5-29.el7_6.1                                
  python-IPy.noarch 0:0.75-6.el7                                                
  rh-php56-php-cli.x86_64 0:5.6.25-1.el7                                        
  rh-php56-php-common.x86_64 0:5.6.25-1.el7                                     
  rh-php56-php-pear.noarch 1:1.9.5-4.el7                                        
  rh-php56-php-pecl-jsonc.x86_64 0:1.3.6-3.el7                                  
  rh-php56-php-pecl-jsonc-devel.x86_64 0:1.3.6-3.el7                            
  rh-php56-runtime.x86_64 0:2.3-1.el7                                           
  setools-libs.x86_64 0:3.3.8-4.el7                                             
  t1lib.x86_64 0:5.1.2-14.el7                                                   

Complete!
Loaded plugins: fastestmirror, ovl
Cleaning repos: base centos-sclo-rh centos-sclo-sclo extras updates
Cleaning up list of fastest mirrors
Other repos take up 30 M of disk space (use --verbose for details)
 ---> f6e1d1252855
Removing intermediate container d3cd88f1e6b8
Step 8 : COPY ./s2i/bin/ $STI_SCRIPTS_PATH
 ---> ec70e190f0c4
Removing intermediate container 789baa35a4e6
Step 9 : COPY ./root/ /
 ---> 4caba3c9683f
Removing intermediate container 817af004b60e
Successfully built 4caba3c9683f
aws@broker 5.6 $


Stage2

During the second phase we build pdo_oci extension.  Be wary that this step takes quite a long time. In order to be able to build pdo_oci, oracle 12 client libraries are required (please see part one of this post). In step 6, we build oci8 extension using pecl. Then we download the sources for rh-php56-php-pdo package. When linking to the oracle 12 library, ldap.h will conflict so it is renamed in step  15. In step 18 we replace the php.spec file with another one that I updated to build pdo_oci rpm.

aws@broker 5.6 docker build -f Dockerfile.stage2 -t yudhiwidyatama/s2i-php56-oci8:stage2 .
Sending build context to Docker daemon 89.48 MB
Sending build context to Docker daemon 
Step 0 : FROM yudhiwidyatama/s2i-php56-oci8-stage1
 ---> 4caba3c9683f
Step 1 : EXPOSE 8080
 ---> Using cache
 ---> 7b78228ff5ea
Step 2 : EXPOSE 8443
 ---> Using cache
 ---> 62d3dbe570ae
Step 3 : ENV PHP_VERSION 5.6 PATH $PATH:/opt/rh/rh-php56/root/usr/bin
 ---> Running in add5db5697e8
 ---> 0775ff086126
Removing intermediate container add5db5697e8
Step 4 : ENV SUMMARY "Platform for building and running PHP $PHP_VERSION applications" DESCRIPTION "PHP $PHP_VERSION available as docker container is a base platform for building and running various PHP $PHP_VERSION applications and frameworks. PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers to write dynamically generated web pages. PHP also offers built-in database integration for several commercial and non-commercial database management systems, so writing a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding is probably as a replacement for CGI scripts."
 ---> Running in 20718f9ea516
 ---> d3b46547e221
Removing intermediate container 20718f9ea516
Step 5 : LABEL summary "$SUMMARY" description "$DESCRIPTION" io.k8s.description "$DESCRIPTION" io.k8s.display-name "Apache 2.4 with PHP 5.6" io.openshift.expose-services "8080:http" io.openshift.tags "builder,php,php56,rh-php56" name "centos/php-56-centos7" com.redhat.component "rh-php56-docker" version "5.6" release "1" maintainer "SoftwareCollections.org "
 ---> Running in c811e53d6122
 ---> d4efb247eeed
Removing intermediate container c811e53d6122
Step 6 : RUN yum install -y /root/oracle-instantclient12* &&     scl enable rh-php56 'pecl install oci8-2.0.12' &&     yum clean all -y
 ---> Running in 141d36b3cd3f
Loaded plugins: fastestmirror, ovl
Examining /root/oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm: oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64
Marking /root/oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm to be installed
Examining /root/oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm: oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64
Marking /root/oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm to be installed
Examining /root/oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm: oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64
Marking /root/oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-instantclient12.1-basic.x86_64 0:12.1.0.2.0-1 will be installed
--> Processing Dependency: libaio for package: oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64
Determining fastest mirrors
 * base: mirror.buana.web.id
 * extras: mirror.buana.web.id
 * updates: mirror.buana.web.id
---> Package oracle-instantclient12.1-devel.x86_64 0:12.1.0.2.0-1 will be installed
---> Package oracle-instantclient12.1-sqlplus.x86_64 0:12.1.0.2.0-1 will be installed
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                          Arch   Version        Repository         Size
================================================================================
Installing:
 oracle-instantclient12.1-basic   x86_64 12.1.0.2.0-1   /oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64
                                                                          185 M
 oracle-instantclient12.1-devel   x86_64 12.1.0.2.0-1   /oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64
                                                                          1.9 M
 oracle-instantclient12.1-sqlplus x86_64 12.1.0.2.0-1   /oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64
                                                                          3.0 M
Installing for dependencies:
 libaio                           x86_64 0.3.109-13.el7 base               24 k

Transaction Summary
================================================================================
Install  3 Packages (+1 Dependent package)

Total size: 190 M
Total download size: 24 k
Installed size: 190 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libaio-0.3.109-13.el7.x86_64                                 1/4 
  Installing : oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64           2/4 
  Installing : oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64           3/4 
  Installing : oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64         4/4 
  Verifying  : libaio-0.3.109-13.el7.x86_64                                 1/4 
  Verifying  : oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64           2/4 
  Verifying  : oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64         3/4 
  Verifying  : oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64           4/4 

Installed:
  oracle-instantclient12.1-basic.x86_64 0:12.1.0.2.0-1                          
  oracle-instantclient12.1-devel.x86_64 0:12.1.0.2.0-1                          
  oracle-instantclient12.1-sqlplus.x86_64 0:12.1.0.2.0-1                        

Dependency Installed:
  libaio.x86_64 0:0.3.109-13.el7                                                

Complete! 
..
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading oci8-2.0.12.tgz ...
Starting to download oci8-2.0.12.tgz (191,954 bytes)
.........................................done: 191,954 bytes
11 source files, building
running: phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] : building in /var/tmp/pear-build-defaultusersm3dKh/oci8-2.0.12
running: /var/tmp/oci8/configure --with-oci8
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
..
Build process completed successfully
Installing '/opt/rh/rh-php56/root/usr/lib64/php/modules/oci8.so'
install ok: channel://pecl.php.net/oci8-2.0.12
configuration option "php_ini" is not set to php.ini location
You should add "extension=oci8.so" to php.ini
Loaded plugins: fastestmirror, ovl
Cleaning repos: base centos-sclo-rh centos-sclo-sclo extras updates
Cleaning up list of fastest mirrors
Other repos take up 30 M of disk space (use --verbose for details)
 ---> e8fd101e147d
Removing intermediate container 3e873b87c3ad
Step 7 : USER 1001
 ---> Running in c96d002c2347
 ---> 4307cca55d51
Removing intermediate container c96d002c2347
Step 8 : RUN yumdownloader --enablerepo=vaultrh --source rh-php56-php-pdo
 ---> Running in f97b271187c4
Loaded plugins: fastestmirror, ovl
ovl: Error while doing RPMdb copy-up:
[Errno 13] Permission denied: '/var/lib/rpm/Packages'
Enabling centos-sclo-rh-source repository
Enabling updates-source repository
Enabling base-source repository
Enabling centos-sclo-sclo-source repository
Enabling extras-source repository
 ---> 58d623dc7075
Removing intermediate container f97b271187c4
Step 9 : USER root
 ---> Running in 8885fd1d4288
 ---> 03dc89ded770
Removing intermediate container 8885fd1d4288
Step 10 : RUN yum-builddep -y rh-php56-php-5.6.25-1.el7.src.rpm
 ---> Running in a805437810bf
Loaded plugins: fastestmirror, ovl
Enabling base-source repository
Enabling centos-sclo-rh-source repository
Enabling centos-sclo-sclo-source repository
Enabling extras-source repository
..
Running transaction test
Transaction test succeeded
Running transaction
  Installing : elfutils-0.172-2.el7.x86_64                                  1/3 
  Installing : file-5.11-35.el7.x86_64                                      2/3 
  Installing : rpm-build-4.11.3-35.el7.x86_64                               3/3 
  Verifying  : rpm-build-4.11.3-35.el7.x86_64                               1/3 
  Verifying  : file-5.11-35.el7.x86_64                                      2/3 
  Verifying  : elfutils-0.172-2.el7.x86_64                                  3/3 

Installed:
  rpm-build.x86_64 0:4.11.3-35.el7                                              

Dependency Installed:
  elfutils.x86_64 0:0.172-2.el7            file.x86_64 0:5.11-35.el7           

Complete!
 ---> 0d75cc66df69
Removing intermediate container eb770b46689a
Step 12 : COPY ./s2i/bin/ $STI_SCRIPTS_PATH
 ---> 13c23ae477f6
Removing intermediate container 1a86c43e9903
Step 13 : ENV PHP_CONTAINER_SCRIPTS_PATH /usr/share/container-scripts/php/ APP_DATA ${APP_ROOT}/src PHP_DEFAULT_INCLUDE_PATH /opt/rh/rh-php56/root/usr/share/pear PHP_SYSCONF_PATH /etc/opt/rh/rh-php56 PHP_HTTPD_CONF_FILE rh-php56-php.conf HTTPD_CONFIGURATION_PATH ${APP_ROOT}/etc/conf.d HTTPD_MAIN_CONF_PATH /etc/httpd/conf HTTPD_MAIN_CONF_D_PATH /etc/httpd/conf.d HTTPD_VAR_RUN /var/run/httpd HTTPD_DATA_PATH /var/www HTTPD_DATA_ORIG_PATH /opt/rh/httpd24/root/var/www HTTPD_VAR_PATH /opt/rh/httpd24/root/var SCL_ENABLED rh-php56
 ---> Running in 2066c7a10274
 ---> b26ffb136e80
Removing intermediate container 2066c7a10274
Step 14 : RUN /usr/libexec/container-setup && rpm-file-permissions
 ---> Running in 72a9895f19b0
    AllowOverride All
 ---> 15a8e007b1ef
Removing intermediate container 72a9895f19b0
Step 15 : RUN mv /usr/include/oracle/12.1/client64/ldap.h /usr/include/oracle/12.1/client64/ldap.h.ori
 ---> Running in defd5f2c069f
 ---> 6fd53234571b
Removing intermediate container defd5f2c069f
Step 16 : USER 1001
 ---> Running in 0dce0ba843bb
 ---> fdb2b67d4a20
Removing intermediate container 0dce0ba843bb
Step 17 : RUN rpm -ivh rh-php56-php-5.6.25-1.el7.src.rpm
 ---> Running in f6f6a7e628af
..
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
 ---> 3026970a49b2
Removing intermediate container f6f6a7e628af
Step 18 : COPY ./php.spec /opt/app-root/src/rpmbuild/SPECS/php.spec
 ---> 7601e45b50af
Removing intermediate container 0cbb51fcce9d
Step 19 : RUN rpmbuild -bb rpmbuild/SPECS/php.spec --define 'scl rh-php56'
 ---> Running in 3832c1a68a61
..
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-pdo-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-pdo_oci-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-mysqlnd-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-pgsql-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-process-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-odbc-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-soap-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-snmp-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-xml-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-xmlrpc-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-mbstring-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-gd-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-bcmath-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-gmp-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-dba-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-pspell-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-recode-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-intl-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-enchant-5.6.25-1.el7.x86_64.rpm
Wrote: /opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-debuginfo-5.6.25-1.el7.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.8Aq09K
+ umask 022
+ cd /opt/app-root/src/rpmbuild/BUILD
+ cd php-5.6.25
+ '[' /opt/app-root/src/rpmbuild/BUILDROOT/rh-php56-php-5.6.25-1.el7.x86_64 '!=' / ']'
+ rm -rf /opt/app-root/src/rpmbuild/BUILDROOT/rh-php56-php-5.6.25-1.el7.x86_64
+ rm files.bcmath files.bz2 files.calendar files.common files.ctype files.curl files.dba files.dom files.enchant files.exif files.fileinfo files.fpm files.ftp files.gd files.gettext files.gmp files.iconv files.intl files.ldap files.mbstring files.mysql files.mysqli files.mysqlnd files.odbc files.opcache files.pdo files.pdo_mysql files.pdo_oci files.pdo_odbc files.pdo_pgsql files.pdo_sqlite files.pgsql files.phar files.posix files.process files.pspell files.recode files.shmop files.simplexml files.snmp files.soap files.sockets files.sqlite3 files.sysvmsg files.sysvsem files.sysvshm files.tokenizer files.wddx files.xml files.xmlreader files.xmlrpc files.xmlwriter files.xsl files.zip macros.php
+ exit 0
 ---> f3dd1494536e
Removing intermediate container 2c7e953622a3
Step 20 : CMD $STI_SCRIPTS_PATH/usage
 ---> Running in 8faf81f6aa31
 ---> 749d23debaa3
Removing intermediate container 8faf81f6aa31
Successfully built 749d23debaa3
aws@broker 5.6 $

Finished compiling all the entire php extensions, lets check out the resulting files.
aws@broker 5.6 $ docker run -it yudhiwidyatama/s2i-php56-oci8:stage2 bash
bash-4.2$ ls
rh-php56-php-5.6.25-1.el7.src.rpm  rpmbuild
bash-4.2$ cd rpmbuild/RPMS
bash-4.2$ cd x86_64/
bash-4.2$ ls -l | grep pdo
-rw-r--r--. 1 default root   101308 Mar 28 22:21 rh-php56-php-pdo-5.6.25-1.el7.x86_64.rpm
-rw-r--r--. 1 default root    47992 Mar 28 22:21 rh-php56-php-pdo_oci-5.6.25-1.el7.x86_64.rpm
bash-4.2$ exit
aws@broker 5.6 $ docker run --name stage2 -it yudhiwidyatama/s2i-php56-oci8:stage2 bash
bash-4.2$ exit
exit
aws@broker 5.6 $ docker start stage2
stage2
aws@broker 5.6 $
Lets copy the files.
aws@broker 5.6 $ docker cp stage2:/opt/app-root/src/rpmbuild/RPMS/x86_64/rh-php56-php-pdo_oci-5.6.25-1.el7.x86_64.rpm rh-php56-php-pdo_oci-5.6.25-1.el7.x86_64.rpm
aws@broker 5.6 $ ls *.rpm
rh-php56-php-pdo_oci-5.6.25-1.el7.x86_64.rpm
aws@broker 5.6 $ docker cp stage2:/opt/rh/rh-php56/root/usr/lib64/php/modules/oci8.so oci8.so
aws@broker 5.6 $ ls -l oci8.so
total 564
-rw-r--r--. 1 aws aws 576208 Mar 29 04:49 oci8.so
aws@broker 5.6 $ 
After copying the oci8.so file and pdo_oci rpm file, we are prepared to finish preparing the final image (the steps are shown in the first part of this post)

Conclusion

It will take a bit of time to prepare pdo_oci rpm and oci8.so files, mainly because base php package doesn't create pdo_oci rpm out of the box and oracle 12 libraries included its own ldap.h which would conflict with php compilation. Recently php56 packages are moved out from centos live repository which needs additonal repo file as workaround.

Comments

Popular posts from this blog

Long running process in Linux using PHP

Reverse Engineering Reptile Kernel module to Extract Authentication code

SAP System Copy Lessons Learned