Skip to content

Commit 4dc5e6c

Browse files
author
builder
committed
Add oracle image
1 parent 962c443 commit 4dc5e6c

12 files changed

+93
-10
lines changed

Dockerfile-oracle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM centos/python-35-centos7
2+
3+
# Set a privileged user to install another dependencies
4+
USER root
5+
COPY rpms/*.rpm /tmp/
6+
RUN yum install -y /tmp/*.rpm &&\
7+
yum clean all -y
8+
9+
ENV LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib:$LD_LIBRARY_PATH
10+
11+
RUN rm -rf /tmp/*.rpm
12+
13+
# This default user after all instalation
14+
USER 1001

Dockerfile-oracle.onbuild

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM centos/python-35-centos7
2+
3+
# Set a privileged user to install another dependencies
4+
USER root
5+
COPY rpms/*.rpm /tmp/
6+
RUN yum install -y /tmp/*.rpm &&\
7+
yum clean all -y
8+
9+
ENV LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib:$LD_LIBRARY_PATH
10+
11+
RUN rm -rf /tmp/*.rpm
12+
13+
ONBUILD ARG GIT_SSL_NO_VERIFY
14+
ONBUILD COPY requirements.txt /opt/app-root/src
15+
ONBUILD USER root
16+
ONBUILD RUN /bin/bash -c "pip install --no-cache-dir -r requirements.txt"
17+
ONBUILD USER 1001
18+
ONBUILD COPY . /opt/app-root/src
19+
20+
# This default user after all instalation
21+
USER 1001
22+
23+
CMD $STI_SCRIPTS_PATH/run

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,26 @@ IMAGE_NAME = python-35-centos7-custom
44
build:
55
docker build -t $(IMAGE_NAME) .
66

7+
.PHONY: test-all
8+
test-all: test test-onbuild test-oracle test-oracle-onbuild
9+
echo "Success"
10+
711
.PHONY: test
812
test:
913
docker build -t $(IMAGE_NAME)-candidate .
10-
IMAGE_NAME=$(IMAGE_NAME)-candidate test/run
14+
IMAGE_NAME=$(IMAGE_NAME)-candidate test/run test-app
1115

1216
.PHONY: test-onbuild
1317
test-onbuild:
1418
docker build -t $(IMAGE_NAME)-onbuild-candidate -f Dockerfile.onbuild .
15-
GIT_SSL_NO_VERIFY=true IMAGE_NAME=$(IMAGE_NAME)-onbuild-candidate test/run-onbuild
19+
GIT_SSL_NO_VERIFY=true IMAGE_NAME=$(IMAGE_NAME)-onbuild-candidate test/run-onbuild test-app
20+
21+
.PHONY: test-oracle
22+
test-oracle:
23+
docker build -t $(IMAGE_NAME)-oracle-candidate -f Dockerfile-oracle .
24+
IMAGE_NAME=$(IMAGE_NAME)-oracle-candidate test/run test-oracle-app
25+
26+
.PHONY: test-oracle-onbuild
27+
test-oracle-onbuild:
28+
docker build -t $(IMAGE_NAME)-oracle-onbuild-candidate -f Dockerfile-oracle.onbuild .
29+
GIT_SSL_NO_VERIFY=true IMAGE_NAME=$(IMAGE_NAME)-oracle-onbuild-candidate test/run-onbuild test-oracle-app
Binary file not shown.
Binary file not shown.

test/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.git/
1+
.git

test/run

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
# IMAGE_NAME specifies a name of the candidate image used for testing.
1010
# The image has to be available before this script is executed.
1111
#
12+
if [ $# -eq 0 ]; then
13+
echo "ERROR: No test project name has been passed."
14+
exit 1
15+
fi
16+
1217
IMAGE_NAME=${IMAGE_NAME-python-35-centos7-custom-candidate}
1318

1419
# Determining system utility executables (darwin compatibility check)
@@ -19,6 +24,7 @@ if [[ "$OSTYPE" =~ 'darwin' ]]; then
1924
! type -a "gmktemp" &>"/dev/null" || MKTEMP_EXEC="gmktemp"
2025
fi
2126

27+
test_project=${1}
2228
test_dir="$($READLINK_EXEC -zf $(dirname "${BASH_SOURCE[0]}"))"
2329
image_dir=$($READLINK_EXEC -zf ${test_dir}/..)
2430
scripts_url="file://${image_dir}/.s2i/bin"
@@ -60,7 +66,7 @@ container_port() {
6066
}
6167

6268
run_s2i_build() {
63-
s2i build --incremental=true ${s2i_args} file://${test_dir}/test-app ${IMAGE_NAME} ${IMAGE_NAME}-testapp
69+
s2i build --incremental=true ${s2i_args} file://${test_dir}/${test_project} ${IMAGE_NAME} ${IMAGE_NAME}-testapp
6470
}
6571

6672
prepare() {
@@ -69,7 +75,7 @@ prepare() {
6975
exit 1
7076
fi
7177
# s2i build requires the application is a valid 'Git' repository
72-
pushd ${test_dir}/test-app >/dev/null
78+
pushd ${test_dir}/${test_project} >/dev/null
7379
git init
7480
git config user.email "build@localhost" && git config user.name "builder"
7581
git add -A && git commit -m "Sample commit"
@@ -90,7 +96,7 @@ cleanup() {
9096
if image_exists ${IMAGE_NAME}-testapp; then
9197
docker rmi ${IMAGE_NAME}-testapp
9298
fi
93-
rm -rf ${test_dir}/test-app/.git
99+
rm -rf ${test_dir}/${test_project}/.git
94100
}
95101

96102
check_result() {

test/run-onbuild

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
# IMAGE_NAME specifies a name of the candidate image used for testing.
1010
# The image has to be available before this script is executed.
1111
#
12+
if [ $# -eq 0 ]; then
13+
echo "ERROR: No test project name has been passed."
14+
exit 1
15+
fi
16+
1217
IMAGE_NAME=${IMAGE_NAME-python-35-centos7-custom-onbuild-candidate}
1318

1419
# Determining system utility executables (darwin compatibility check)
@@ -19,6 +24,7 @@ if [[ "$OSTYPE" =~ 'darwin' ]]; then
1924
! type -a "gmktemp" &>"/dev/null" || MKTEMP_EXEC="gmktemp"
2025
fi
2126

27+
test_project=${1}
2228
test_dir="$($READLINK_EXEC -zf $(dirname "${BASH_SOURCE[0]}"))"
2329
image_dir=$($READLINK_EXEC -zf ${test_dir}/..)
2430
scripts_url="file://${image_dir}/.s2i/bin"
@@ -56,7 +62,7 @@ container_port() {
5662
}
5763

5864
run_build() {
59-
docker build --build-arg "GIT_SSL_NO_VERIFY=$GIT_SSL_NO_VERIFY" -t ${IMAGE_NAME}-testapp ${test_dir}/test-app
65+
docker build --build-arg "GIT_SSL_NO_VERIFY=$GIT_SSL_NO_VERIFY" -t ${IMAGE_NAME}-testapp ${test_dir}/${test_project}
6066
}
6167

6268
prepare() {
@@ -65,7 +71,7 @@ prepare() {
6571
exit 1
6672
fi
6773
# s2i build requires the application is a valid 'Git' repository
68-
pushd ${test_dir}/test-app >/dev/null
74+
pushd ${test_dir}/${test_project} >/dev/null
6975
git init
7076
git config user.email "build@localhost" && git config user.name "builder"
7177
git add -A && git commit -m "Sample commit"
@@ -85,7 +91,7 @@ cleanup() {
8591
if image_exists ${IMAGE_NAME}-testapp; then
8692
docker rmi ${IMAGE_NAME}-testapp
8793
fi
88-
rm -rf ${test_dir}/test-app/.git
94+
rm -rf ${test_dir}/${test_project}/.git
8995
}
9096

9197
check_result() {

test/test-app/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
cryptography==1.5.2
2-
Eve==0.7.1
2+
Eve==0.7.4
33
PyYAML==3.12

test/test-oracle-app/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM python-35-centos7-custom-oracle-onbuild-candidate
2+
3+
# COPY requirements.txt /tmp
4+
RUN touch dummy.txt

0 commit comments

Comments
 (0)