forked from oracle/docker-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
92 lines (85 loc) · 4.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
# ORACLE GOLDENGATE DOCKER PROJECT
# --------------------------------
#
# Dockerfile for Oracle GoldenGate
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
#
# From http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html
# Download the file for "Oracle GoldenGate 12.x.x.x.x for Oracle on Linux x86-64"
# - fbo_ggs_Linux_x64_shiphome.zip
#
# HOW TO BUILD THIS IMAGE
# -----------------------
#
# Execute the "dockerBuild.sh" shell script, with the name of the downloaded OGG filename.
# Example:
# $ ./dockerBuild.sh ~/Downloads/fbo_ggs_Linux_x64_shiphome.zip
#
ARG BASE_IMAGE=oracle/instantclient:12.2.0.1
FROM ${BASE_IMAGE}
LABEL Description="Oracle GoldenGate on Docker" \
Maintainer="Stephen Balousek <[email protected]>"
USER root
ARG OGG_VERSION
ARG OGG_EDITION
ARG OGG_TARFILE
ARG BASE_COMMAND
ENV JAVA_HOME=/usr/lib/jvm/jre \
OGG_HOME=/u01/app/ogg \
OGG_DEPLOY_BASE=/u02/ogg \
PATH=/u01/app/ogg:/u01/app/ogg/bin:/usr/lib/jvm/jre/bin:${PATH} \
LD_LIBRARY_PATH=/usr/lib/jvm/jre/lib/amd64/server:${LD_LIBRARY_PATH} \
OGG_VERSION=${OGG_VERSION} \
OGG_EDITION=${OGG_EDITION} \
BASE_COMMAND=${BASE_COMMAND}
ADD ${OGG_TARFILE} ${OGG_HOME}/
COPY runOracleGoldenGate.sh /
COPY bin/* /usr/local/bin/
#
# Initial setup
# - This image will be smaller if the oracle:oinstall user has the numeric identifiers 54321:54321
# - 'vi' is used by the Oracle GoldenGate 'ggsci' utility to edit parameter
# files and must be run from inside the container.
# - Installation of additional software packages depends on the value of ${OGG_EDITION}
#
RUN if [[ -z "${OGG_VERSION}" || -z "${OGG_EDITION}" || -z "${OGG_TARFILE}" ]]; then \
echo "----------------------------------------------------------------------------------" && \
echo "-- Missing build argument for Dockerfile. See README.md for usage instructions. --" && \
echo "----------------------------------------------------------------------------------" && \
exit 1; \
fi; \
groupadd -g 54321 oinstall || /bin/true; \
useradd -u 54321 -g oinstall oracle || /bin/true; \
chown oracle:oinstall ${OGG_HOME}; \
if [[ $(find ${OGG_HOME} -mindepth 1 -maxdepth 1 -user 54321 -group 54321 2>/dev/null | wc -l) == "0" ]]; then \
echo "----------------------------------------------------------------------------------" && \
echo "-- OGG_TARFILE '${OGG_TARFILE}' not using UID:GID of 54321:54321" && \
echo "-- Resulting Docker image will be larger than necessary. --" && \
echo "----------------------------------------------------------------------------------" && \
chown -R oracle:oinstall ${OGG_HOME}; \
fi; \
. /etc/os-release && MAJOR_VERSION="${VERSION/.*/}"; \
yum-config-manager --enable ol${MAJOR_VERSION}_optional_latest; \
yum -y install oracle-softwarecollection-release-el${MAJOR_VERSION}; \
[[ -x /usr/bin/ol_yum_configure.sh ]] && /usr/bin/ol_yum_configure.sh; \
if [[ "${OGG_EDITION}" == "standard" ]]; then \
yum -y install util-linux vi java-1.8.0-openjdk-headless && \
rm -rf /var/cache/yum; \
fi; \
if [[ "${OGG_EDITION}" == "microservices" ]]; then \
yum -y --enablerepo ol${MAJOR_VERSION}_software_collections install openssl rh-nginx18 java-1.8.0-openjdk-headless python-requests && \
rm -rf /var/cache/yum && \
ln -s /etc/opt/rh/rh-nginx18/nginx /etc/nginx && \
sh /etc/ssl/certs/make-dummy-cert /etc/nginx/ogg.pem && \
mkdir -p ${OGG_DEPLOY_BASE} && \
chown oracle:oinstall ${OGG_DEPLOY_BASE}; \
fi;
EXPOSE 443
VOLUME ["${OGG_DEPLOY_BASE}" ]
WORKDIR "${OGG_HOME}"
ENTRYPOINT ["/runOracleGoldenGate.sh"]