Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EventsAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jards
EventsAPI
Commits
3314a017
Commit
3314a017
authored
7 years ago
by
Carsten Karbach
Browse files
Options
Downloads
Patches
Plain Diff
Add setup for oracle instant client
parent
f692a25c
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dockerfile
+65
-0
65 additions, 0 deletions
Dockerfile
build_docker.sh
+2
-0
2 additions, 0 deletions
build_docker.sh
utils/Commands.txt
+11
-0
11 additions, 0 deletions
utils/Commands.txt
utils/build_oracle_pdo_oci.sh
+33
-0
33 additions, 0 deletions
utils/build_oracle_pdo_oci.sh
with
111 additions
and
0 deletions
Dockerfile
+
65
−
0
View file @
3314a017
FROM
ubuntu:16.04
MAINTAINER
Carsten Karbach (c.karbach@fz-juelich.de)
ARG
oic=rpms/oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
ARG
osdk=rpms/oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
ARG
osqlplus=rpms/oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm
# install dependencies, certificates, apache
RUN
apt-get update
\
&&
apt-get
install
-y
--no-install-recommends
ca-certificates
\
...
...
@@ -28,6 +32,67 @@ RUN apt-get update && \
# Install composer
RUN
cd
/tmp
&&
curl
-sS
https://getcomposer.org/installer | php
&&
mv
composer.phar /usr/local/bin/composer
#Oracle Envs
RUN
echo
"# Oracle Instant Client"
>>
/etc/environment
&&
\
echo
"LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64"
>>
/etc/environment
&&
\
echo
"TNS_ADMIN=/usr/lib/oracle/12.2/client64"
>>
/etc/environment
&&
\
echo
"ORACLE_BASE=/usr/lib/oracle/12.2/client64"
>>
/etc/environment
&&
\
echo
"ORACLE_HOME=/usr/lib/oracle/12.2/client64"
>>
/etc/environment
&&
\
echo
"NLS_LANG=GERMAN_GERMANY.WE8MSWIN1252"
>>
/etc/environment
&&
\
echo
'NLS_NUMERIC_CHARACTERS=". "'
>>
/etc/environment
#Make variables also available to www-data user in apache
RUN
echo
'export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64'
>>
/etc/apache2/envvars
&&
\
echo
'export TNS_ADMIN=/usr/lib/oracle/12.2/client64'
>>
/etc/apache2/envvars
&&
\
echo
'export ORACLE_BASE=/usr/lib/oracle/12.2/client64'
>>
/etc/apache2/envvars
&&
\
echo
'export ORACLE_HOME=/usr/lib/oracle/12.2/client64'
>>
/etc/apache2/envvars
&&
\
echo
'export NLS_LANG=GERMAN_GERMANY.WE8MSWIN1252'
>>
/etc/apache2/envvars
&&
\
echo
'export NLS_NUMERIC_CHARACTERS=". "'
>>
/etc/apache2/envvars
#PHP PDO OCI Stuff... really annoying!
RUN
mkdir
/tmp/rpms
ADD
$oic $osdk $osqlplus /tmp/rpms/
ENV
ORACLE_HOME /usr/lib/oracle/12.2/client64
#change workdir to tmp
WORKDIR
/tmp
#install oracle instant client and compile php oci and pdo extensions.
ADD
utils/build_oracle_pdo_oci.sh /tmp/
RUN
apt-get update
&&
apt-get
install
-y
--no-install-recommends
\
alien
\
build-essential
\
gcc
\
libxml2-dev
\
make
\
php-pear
\
php7.0-dev
\
wget
\
&&
\
alien
-i
/tmp/
$oic
&&
\
alien
-i
/tmp/
$osdk
&&
\
alien
-i
/tmp/
$osqlplus
&&
\
echo
"/usr/lib/oracle/12.2/client64/lib"
>
/etc/ld.so.conf.d/oracle.conf
&&
ldconfig
&&
\
./build_oracle_pdo_oci.sh
&&
\
apt-get
-y
purge
\
alien
\
build-essential
\
gcc
\
libxml2-dev
\
make
\
php7.0-dev
\
wget
\
&&
\
apt-get
-y
autoremove
&&
\
rm
-rf
/var/lib/apt/lists/
*
RUN
apt-get update
&&
apt-get
install
-y
--no-install-recommends
libaio1
&&
\
apt-get
-y
autoremove
&&
\
rm
-rf
/var/lib/apt/lists/
*
WORKDIR
/root
# Setup for EventsAPI application
RUN
rm
/var/www/html/index.html
# Add EventsApi source
...
...
This diff is collapsed.
Click to expand it.
build_docker.sh
+
2
−
0
View file @
3314a017
...
...
@@ -12,6 +12,8 @@ if test -e "$APACHE_SSL_CERT_KEY";then
cp
$APACHE_SSL_CERT_KEY
./servercerts/ssl-cert-eventsapi.key
fi
cp
~/workspace/dockerenv/
*
.rpm rpms
docker build
-t
karbach/restapi:v1
.
#Clear automatically created folders
...
...
This diff is collapsed.
Click to expand it.
utils/Commands.txt
+
11
−
0
View file @
3314a017
...
...
@@ -11,3 +11,14 @@ docker run -d -p 8081:80 -p 4433:443 -v /path/to/folder/on/host:/var/www/html/Ev
- add the files ./configs/certificates/ssl-cert-eventsapi.pem and ./configs/certificates/ssl-cert-eventsapi.key as certificate and key file
- go into EventsAPI root folder and run ./build_docker.sh
- launch the container with ./launch_docker.sh
# Build with Oracle Instant client
- Download Oracle Instant client RPMs from http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
- oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
- oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
- oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm
- Place files into rpms folder
- Use Dockerfile to install and compile PHP with oracle instant client
- Configure DB credentials in configs/dbaccess.cnf
- Test DB access with examples/dbaccesstest.php
This diff is collapsed.
Click to expand it.
utils/build_oracle_pdo_oci.sh
0 → 100755
+
33
−
0
View file @
3314a017
#install and configure OCI8
DIR
=
$(
mktemp
-d
)
cd
$DIR
pecl channel-update pecl.php.net
&&
\
pecl download OCI8-2.1.4
&&
\
tar
zxvf oci8-2.1.4.tgz
||
exit
1
cd
oci8-2.1.4
||
exit
1
phpize
&&
\
./configure
--with-oci8
=
instantclient,/usr/lib/oracle/12.2/client64/lib
&&
\
make
install
||
exit
1
#register OCI with PHP
echo
"extension=oci8.so"
>
/etc/php/7.0/mods-available/oci8.ini
&&
\
ln
-s
/etc/php/7.0/mods-available/oci8.ini /etc/php/7.0/apache2/conf.d/oci8.ini
&&
\
ln
-s
/etc/php/7.0/mods-available/oci8.ini /etc/php/7.0/cli/conf.d/oci8.ini
||
exit
1
#recompile PHP PDO OCI
wget https://github.com/php/php-src/archive/PHP-7.0.22.zip
&&
\
unzip PHP-7.0.22.zip
||
exit
1
cd
php-src-PHP-7.0.22/ext/pdo_oci/
||
exit
1
sed
-i
s/11.1
\
12.1/11.2
\
12.1
\
12.2/ config.m4
&&
\
sed
-i
s/11.2
\|
12.1/11.2
\|
12.1
\|
12.2/ config.m4
&&
\
phpize
&&
\
./configure
--with-pdo-oci
=
instantclient,/usr,12.2
&&
\
make
install
&&
\
make clean
&&
\
echo
"extension=pdo_oci.so"
>
/etc/php/7.0/mods-available/pdo_oci.ini
&&
\
ln
-s
/etc/php/7.0/mods-available/pdo_oci.ini /etc/php/7.0/apache2/conf.d/pdo_oci.ini
&&
\
ln
-s
/etc/php/7.0/mods-available/pdo_oci.ini /etc/php/7.0/cli/conf.d/pdo_oci.ini
||
exit
1
cd
/
rm
-rf
$DIR
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment