Skip to content

Commit efdf6a4

Browse files
authored
Oracle GoldenGate on Docker (#2043)
1 parent 9d43ab5 commit efdf6a4

17 files changed

+1157
-32
lines changed

OracleGoldenGate/12c-19c/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Additional utilities, installed to the Docker Image at `/usr/local/bin`, can be
297297
None
298298
299299
## License
300-
All scripts and files hosted in this project and GitHub [docker-images/OracleGoldenGate](../) repository required to build the Docker images are, unless otherwise noted, released under the Universal Permissive License (UPL), Version 1.0. See [LICENSE](../LICENSE) for details.
300+
All scripts and files hosted in this project and GitHub [docker-images/OracleGoldenGate](../) repository required to build the Docker images are, unless otherwise noted, released under the Universal Permissive License (UPL), Version 1.0. See [LICENSE](/LICENSE) for details.
301301
302302
To download and run Oracle GoldenGate, regardless whether inside or outside a Docker container, you must download the binaries from the [Oracle Technology Network](http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html) and accept the license indicated at that page.
303303

OracleGoldenGate/21c/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Copyright (c) 2021, Oracle and/or its affiliates.
2+
FROM oraclelinux:8
3+
LABEL maintainer="Stephen Balousek<[email protected]>"
4+
5+
ARG INSTALLER
6+
RUN : ${INSTALLER:?}
7+
8+
ENV OGG_HOME "/u01/ogg"
9+
ENV OGG_DEPLOYMENT_HOME "/u02"
10+
ENV OGG_TEMPORARY_FILES "/u03"
11+
ENV PATH "${OGG_HOME}/bin:${PATH}"
12+
13+
COPY install-*.sh /tmp/
14+
COPY ${INSTALLER} /tmp/installer.zip
15+
COPY bin/ /usr/local/bin/
16+
17+
RUN bash -c /tmp/install-prerequisites.sh && \
18+
bash -c /tmp/install-deployment.sh && \
19+
rm -fr /tmp/* /etc/nginx
20+
21+
COPY nginx/ /etc/nginx/
22+
23+
EXPOSE 443
24+
VOLUME [ "${OGG_DEPLOYMENT_HOME}", "${OGG_TEMPORARY_FILES}" ]
25+
HEALTHCHECK --start-period=90s --retries=1 \
26+
CMD [ "/usr/local/bin/healthcheck" ]
27+
ENTRYPOINT [ "/usr/local/bin/deployment-main.sh" ]

OracleGoldenGate/21c/README.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# Oracle GoldenGate 21.3 Microservices Edition Container Images
2+
3+
Sample container image build files to provide an installation of Oracle GoldenGate for DevOps users.
4+
These instructions apply to building container images for Oracle GoldenGate version 21c.
5+
6+
## Contents
7+
8+
* [Before You Start](#before-you-start)
9+
* [Build an Oracle GoldenGate Container Image](#build-an-oracle-goldengate-container-image)
10+
* [Running Oracle GoldenGate in a Container](#running-oracle-goldengate-in-a-container)
11+
* [Administrative Account Password](#administrative-account-password)
12+
* [SSL Certificate](#ssl-certificate)
13+
* [Running the Administration Client](#running-the-administration-client)
14+
* [Known Issues](#known-issues)
15+
* [License](#license)
16+
* [Copyright](#copyright)
17+
18+
## Before You Start
19+
20+
This project was tested with:
21+
22+
* Oracle GoldenGate 21.3.0.0.0 Microservices for Oracle
23+
24+
Support for Oracle GoldenGate Classic Architecture is not provided.
25+
26+
**IMPORTANT:** You must download the installation binaries of Oracle GoldenGate. You only need to provide the binaries for the version you plan to install. The binaries can be downloaded from the [Oracle Technology Network](http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html). Do not decompress the Oracle GoldenGate ZIP file. The container build process will handle that for you. You also must have Internet connectivity when building the container image for the package manager to perform additional software installations.
27+
28+
All shell commands in this document assume the usage of Bash shell.
29+
30+
For more information about Oracle GoldenGate please see the [Oracle GoldenGate 21.3 On-line Documentation](https://docs.oracle.com/en/middleware/goldengate/core/21.3/index.html).
31+
32+
## Build an Oracle GoldenGate Container Image
33+
34+
Once you have downloaded the Oracle GoldenGate software, a container image can be created using the Docker command-line interface.
35+
A single `--build-arg` is needed to indicate the GoldenGate installer which was downloaded.
36+
37+
```sh
38+
$ docker build --tag=oracle/goldengate:21.3.0.0.0 \
39+
--build-arg INSTALLER=fbo_ggs_Linux_x64_Oracle_services_shiphome.zip .
40+
Sending build context to Docker daemon
41+
...
42+
Successfully tagged oracle/goldengate:21.3.0.0.0
43+
```
44+
45+
## Running Oracle GoldenGate in a Container
46+
47+
Use the `docker run` command to create and start a container from the Oracle GoldenGate container image.
48+
49+
```sh
50+
$ docker run \
51+
--name <container name> \
52+
-p <host port>:443 \
53+
-e OGG_ADMIN=<admin user name> \
54+
-e OGG_ADMIN_PWD=<admin password> \
55+
-e OGG_DEPLOYMENT=<deployment name> \
56+
-v [<host mount point>:]/u02 \
57+
-v [<host mount point>:]/u03 \
58+
-v [<host mount point>:]/etc/nginx/cert \
59+
oracle/goldengate:21.3.0.0.0
60+
```
61+
62+
Parameters:
63+
64+
* `<container name>` - A name for the new container (default: auto generated)
65+
* `-p <host-port>` - The host port to map to the Oracle GoldenGate HTTPS server (default: no mapping)
66+
* `-e OGG_ADMIN` - The name of the administrative account to create (default: `oggadmin`)
67+
* `-e OGG_ADMIN_PWD` - The password for the administrative account (default: auto generated)
68+
* `-e OGG_DEPLOYMENT` - The name of the deployment (default: `Local`)
69+
* `-v /u02` - The volume used for persistent GoldenGate data (default: use container storage)
70+
* `-v /u03` - The volume used for temporary GoldenGate data (default: use container storage)
71+
* `-v /etc/nginx/cert` - The volume used for storing the SSL certificate for the HTTPS server (default: create a self-signed certificate)
72+
73+
All parameters are optional, so the following command will work, too:
74+
75+
```sh
76+
$ docker run oracle/goldengate:21.3.0.0.0
77+
----------------------------------------------------------------------------------
78+
-- Password for OGG administrative user 'oggadmin' is 'XU2k7cMastmt-DJKs'
79+
----------------------------------------------------------------------------------
80+
...
81+
```
82+
83+
See the following sections for additional details.
84+
85+
### Administrative Account Password
86+
87+
On the first startup of the container, a random password will be generated for the Oracle GoldenGate administrative user if not provided by the `OGG_ADMIN_PWD` environment variable. You can find this password at the start of the container log:
88+
89+
```sh
90+
$ docker logs <container name> | head -3
91+
----------------------------------------------------------------------------------
92+
-- Password for OGG administrative user 'oggadmin' is 'ujX7sqQ430G9-xSlr'
93+
----------------------------------------------------------------------------------
94+
```
95+
96+
### SSL Certificate
97+
98+
When bringing your own SSL certificate to an Oracle GoldenGate container, two files are needed:
99+
100+
1. `ogg.key` - The private key for the SSL certificate.
101+
1. `ogg.pem` - The SSL leaf certificate, and a full certificate trust chain
102+
103+
If these files are located in a directory called `cert`, they can be used in the GoldenGate container with a volume mount as shown here:
104+
105+
```sh
106+
$ docker run -v ${PWD}/cert:/etc/nginx/cert:ro -p 8443:443 ogg-21c
107+
...
108+
```
109+
110+
The certificate file, `ogg.pem`, must contain a full certificate chain starting with the leaf certificate, and followed by all other certificates in the Certificate Authority chain.
111+
112+
```pem
113+
-----BEGIN CERTIFICATE-----
114+
MIIFBTCCA+2gAwIBAgISBJSzNXE+Ha5eDw76N5lgHhTpMA0GCSqGSIb3DQEBCwUA
115+
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
116+
...
117+
dr7wTE+AQwcOLAGjIvFOL7GK8JrhKvuFvnSoys/1O2CK3vVhBgS+mEF6D+QjIGTv
118+
VC01LCPT51q58INy4RtDBPSqlJwrzz+pOOWd5rBWhu2UPktVHz3AtYE=
119+
-----END CERTIFICATE-----
120+
-----BEGIN CERTIFICATE-----
121+
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
122+
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
123+
...
124+
PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6
125+
KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==
126+
-----END CERTIFICATE-----
127+
```
128+
129+
### Running the Administration Client
130+
131+
The **Administration Client** utility can be run with this command:
132+
133+
```sh
134+
$ docker exec -ti --user ogg <container name> adminclient
135+
Oracle GoldenGate Administration Client for Oracle
136+
Version 21.3.0.0.0 ...
137+
```
138+
139+
## Known Issues
140+
141+
None
142+
143+
## License
144+
145+
All scripts and files hosted in this project and GitHub [docker-images/OracleGoldenGate](../) repository required to build the container images are, unless otherwise noted, released under the Universal Permissive License (UPL), Version 1.0. See [LICENSE](/LICENSE) for details.
146+
147+
To download and run Oracle GoldenGate, regardless whether inside or outside a container, you must download the binaries from the [Oracle Technology Network](http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html) and accept the license indicated at that page.
148+
149+
## Copyright
150+
151+
Copyright &copy; 2021 Oracle and/or its affiliates.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
## Copyright (c) 2021, Oracle and/or its affiliates.
3+
set -e
4+
5+
: "${NGINX_CRT:?}"
6+
: "${NGINX_KEY:?}"
7+
8+
##
9+
## c r e a t e _ c e r t i f i c a t e
10+
## Create a self-signed certificate/key pair
11+
##
12+
function create_certificate() {
13+
local config
14+
config="$(mktemp)"
15+
cat<<EOF > "${config}"
16+
[req]
17+
distinguished_name = distinguished_name
18+
x509_extensions = x509_extensions
19+
prompt = no
20+
21+
[distinguished_name]
22+
CN = GoldenGate Deployment
23+
24+
[x509_extensions]
25+
extendedKeyUsage = serverAuth
26+
EOF
27+
mkdir -p "$(dirname "${NGINX_CRT}")"
28+
openssl req -x509 -sha256 \
29+
-newkey rsa:2048 -nodes -keyout "${NGINX_KEY}" \
30+
-days $((365 * 3)) -out "${NGINX_CRT}" \
31+
-config "${config}"
32+
rm "${config}"
33+
}
34+
35+
create_certificate

0 commit comments

Comments
 (0)