Skip to content

Commit d102d1d

Browse files
authored
Add latest DNS changes (#2753)
docker compose completed with blockdevices NFS tested with RAC on Docker with Docker Compose NEW DNS all testing completed with Podman and Podman Compose
1 parent 1348358 commit d102d1d

File tree

30 files changed

+1392
-752
lines changed

30 files changed

+1392
-752
lines changed

OracleDatabase/RAC/OracleConnectionManager/README.md

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,74 @@ Sample container build files to facilitate installation, configuration, and envi
33

44
## How to build and run
55
This project offers sample container images for:
6-
* Oracle Database 21c Client (21.3) for Linux x86-64
7-
* Oracle Database 19c Client (19.3) for Linux x86-64
8-
* Oracle Database 18c Client (18.3) for Linux x86-64
9-
* Oracle Database 12c Release 2 Client (12.2.0.1.0) for Linux x86-64
6+
* Oracle Database 21c Client (21.3) for Linux x86-64
7+
* Oracle Database 19c Client (19.3) for Linux x86-64
8+
* Oracle Database 18c Client (18.3) for Linux x86-64
9+
* Oracle Database 12c Release 2 Client (12.2.0.1.0) for Linux x86-64
1010

1111
To assist in building the container images, you can use the [buildContainerImage.sh](dockerfiles/buildContainerImage.sh) script. See section **Create Oracle Connection Manager Image** for instructions and usage.
1212

1313
**IMPORTANT:** Oracle Connection Manager binds to a single port on your host and proxies incoming connections to multiple running containers. It can also proxy connections for users to Oracle RAC Databases running on internal container networks.
1414

15+
If you are on Podman Host, please ensure that you have the `podman-docker` package installed on your OL8 Podman host to run the command using the docker utility.
16+
```bash
17+
dnf install podman-docker -y
18+
```
19+
1520
For complete Oracle Connection Manager setup, please go though following steps and execute them as per your enviornment:
1621

1722
### Create Oracle Connection Manager Image
18-
**IMPORTANT:** You will have to provide the installation binaries of Oracle ADMIN Client Oracle Database 21c Client (21.3) for Linux x86-64 and put them into the `dockerfiles/<version>` folder. You only need to provide the binaries for the edition you are going to install. The binaries can be downloaded from the [Oracle Technology Network](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html). You also have to make sure to have internet connectivity for yum. Note that you must not uncompress the binaries.
23+
**IMPORTANT:** You will have to provide the installation binaries of Oracle ADMIN Client Oracle Database 21c Client (21.3) for Linux x86-64 and put them into the `dockerfiles/<version>` folder. You only need to provide the binaries for the edition you are going to install.
1924

20-
The `buildContainerImage.sh` script is just a utility shell script that performs MD5 checks and is an easy way for beginners to get started. Expert users are welcome to directly call `docker build` with their prefered set of parameters.Before you build the image make sure that you have provided the installation binaries and put them into the right folder. Go into the **dockerfiles** folder and run the **buildContainerImage.sh** script as root or with sudo privileges:
25+
The binaries can be downloaded from the [Oracle Technology Network](http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html).
2126

22-
```
27+
You also have to make sure to have internet connectivity for yum. Note that you must not uncompress the binaries.
28+
29+
The `buildContainerImage.sh` script is just a utility shell script that performs MD5 checks and is an easy way for beginners to get started. Expert users are welcome to directly call `docker build` with their prefered set of parameters.
30+
31+
Before you build the image make sure that you have provided the installation binaries and put them into the right folder. Go into the **dockerfiles** folder and run the **buildContainerImage.sh** script as root or with sudo privileges:
32+
33+
```bash
34+
cd <git-cloned-path>/docker-images/OracleDatabase/RAC/OracleConnectionManager/dockerfiles
2335
./buildContainerImage.sh -v (Software Version)
2436
./buildContainerImage.sh -v 21.3.0
2537
```
2638
For detailed usage of command, please execute following command:
27-
```
39+
```bash
40+
cd <git-cloned-path>/docker-images/OracleDatabase/RAC/OracleConnectionManager/dockerfiles
2841
./buildContainerImage.sh -h
2942
```
3043

3144
### Create Network Bridge
3245
Before creating container, create the bridge. If you are using same bridge with same network then you can use same IPs mentioned in **Create Containers** section.
3346

34-
```
47+
```bash
3548
docker network create --driver=bridge --subnet=172.16.1.0/24 rac_pub1_nw
3649
```
3750

3851
**Note:** You can change subnet according to your environment.
52+
### Create Containers
3953

40-
### Create Containers.
41-
Execute following command as root user to create connection manager container.
54+
Execute following command as root user to create connection manager container on `Docker Host`-
4255

56+
```bash
57+
docker run -d --hostname racnodedc1-cman --dns-search=example.com \
58+
--network=rac_pub1_nw --ip=172.16.1.164 \
59+
-e DOMAIN=example.com -e PUBLIC_IP=172.16.1.164 \
60+
-e PUBLIC_HOSTNAME=racnodedc1-cman -e SCAN_NAME=racnodedc1-scan \
61+
-e SCAN_IP=172.16.1.230 --privileged=false \
62+
-p 1521:1521 --name racnodedc1-cman oracle/client-cman:21.3.0
4363
```
44-
/usr/bin/docker run -d --hostname racnode-cman1 --dns-search=example.com \
45-
--network=rac_pub1_nw --ip=172.16.1.15 \
46-
-e DOMAIN=example.com -e PUBLIC_IP=172.16.1.15 \
47-
-e PUBLIC_HOSTNAME=racnode-cman1 -e SCAN_NAME=racnode-scan \
48-
-e SCAN_IP=172.16.1.70 --privileged=false \
49-
-p 1521:1521 --name racnode-cman oracle/client-cman:21.3.0
64+
65+
Execute following command as root user to create connection manager container on `Podman Host`-
66+
67+
```bash
68+
docker run -d --hostname racnodepc1-cman --dns-search=example.com \
69+
--network=rac_pub1_nw --ip=172.16.1.166 \
70+
-e DOMAIN=example.com -e PUBLIC_IP=172.16.1.166 \
71+
-e PUBLIC_HOSTNAME=racnodepc1-cman -e SCAN_NAME=racnodepc1-scan \
72+
-e SCAN_IP=172.16.1.236 --privileged=false \
73+
-p 1521:1521 --name racnodepc1-cman oracle/client-cman:21.3.0
5074
```
5175

5276
In the above container, you can see that we are passing env variables using "-e". You need to change PUBLIC_IP, PUBLIC_HOSTNAME, SCAN_NAME, SCAN_IP according to your environment. Also, container will be binding to port 1521 on your docker host.
@@ -55,13 +79,19 @@ In the above container, you can see that we are passing env variables using "-e"
5579

5680
To check the Cman container/services creation logs , please tail docker logs. It will take 2 minutes to create the Cman container service.
5781

82+
Check logs in `Docker Host` -
83+
```bash
84+
docker logs racnodedc1-cman
5885
```
59-
docker logs racnode-cman
86+
87+
Check logs in `Podman Host` -
88+
```bash
89+
docker logs racnodepc1-cman
6090
```
6191

6292
You should see following when cman container setup is done:
6393

64-
```
94+
```bash
6595
###################################
6696
CONNECTION MANAGER IS READY TO USE!
6797
###################################

OracleDatabase/RAC/OracleDNSServer/README.md

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ Sample container build files to facilitate installation, configuration, and envi
77
## How to build and run
88
You need to make sure that you have at least 350MB of space available for the container to create the files for RAC DNS server.
99

10-
**IMPORTANT:** If you are behind a proxy, you need to set the `http_proxy or https_proxy` env variable based on your environment before building the image.
10+
**IMPORTANT:** If you are behind a proxy, you need to set the `http_proxy or https_proxy` env variable based on your environment before building the image. Please ensure that you have the `podman-docker` package installed on your OL8 Podman host to run the command using the docker utility.
11+
```bash
12+
dnf install podman-docker -y
13+
```
1114

1215
The `buildContainerImage.sh` script can assist with building the images. See below for instructions and usage.
1316

1417
The `buildContainerImage.sh` script is a utility shell script that performs MD5 checks and is an easy way to get started. Users can also use the docker build command to build an image with custom configuration parameters. To run the script, go into the `dockerfiles` folder and run the `buildContainerImage.sh` script:
1518

1619
```bash
20+
cd <git-cloned-path>/docker-images/OracleDatabase/RAC/OracleDNSServer/dockerfiles
1721
./buildContainerImage.sh-v <Software Version>
1822
./buildContainerImage.sh -v latest
1923
```
@@ -30,32 +34,50 @@ Before you create the DNS server container, ensure you have created the required
3034

3135
```bash
3236
docker network create --driver=bridge --subnet=172.16.1.0/24 rac_pub1_nw
37+
docker network create --driver=bridge --subnet=192.168.17.0/24 rac_priv1_nw
3338
```
3439
**Note:** You can change the subnet according to your environment.
3540

3641
### Running RAC DNS server container
3742
Execute following command to create the container:
3843

3944
```bash
40-
docker run -d --name racdns \
41-
--hostname rac-dns \
42-
--dns-search="example.com" \
43-
--cap-add=SYS_ADMIN \
44-
--network rac_pub1_nw \
45-
--ip 172.16.1.25 \
46-
--sysctl net.ipv6.conf.all.disable_ipv6=1 \
47-
--env SETUP_DNS_CONFIG_FILES="setup_true" \
48-
--env DOMAIN_NAME="example.com" \
49-
--env RAC_NODE_NAME_PREFIX="racnode" \
45+
docker create --hostname racdns \
46+
--dns-search=example.com \
47+
--cap-add=AUDIT_WRITE \
48+
-e DOMAIN_NAME="example.com" \
49+
-e PRIVATE_DOMAIN_NAME="example-priv.com" \
50+
-e WEBMIN_ENABLED=false \
51+
-e RAC_NODE_NAME_PREFIXD="racnoded" \
52+
-e RAC_NODE_NAME_PREFIXP="racnodep" \
53+
-e SETUP_DNS_CONFIG_FILES="setup_true" \
54+
--privileged=false \
55+
--name rac-dnsserver \
5056
oracle/rac-dnsserver:latest
5157
```
58+
Connect networks to DNS container in DockerHost-
59+
```bash
60+
docker network disconnect bridge rac-dnsserver
61+
docker network connect rac_pub1_nw --ip 172.16.1.25 rac-dnsserver
62+
docker network connect rac_priv1_nw --ip 192.168.17.25 rac-dnsserver
63+
docker start rac-dnsserver
64+
```
5265

66+
Connect networks to DNS container in PodmanHost-
67+
```bash
68+
podman network disconnect podman rac-dnsserver
69+
podman network connect rac_pub1_nw --ip 172.16.1.25 rac-dnsserver
70+
podman network connect rac_priv1_nw --ip 192.168.17.25 rac-dnsserver
71+
podman start rac-dnsserver
72+
```
5373
In the above example, we used **172.16.1.0/24** subnet for the DNS server. You can change the subnet values according to your environment.
5474

75+
Also, `RAC_NODE_NAME_PREFIXD`, `RAC_NODE_NAME_PREFIXP`, and `PRIVATE_DOMAIN_NAME` are optional environment variables. You can utilize one depending on whether you are planning to use DNS Server on Docker or Podman Host and want to utilize the Private Network Domain respectively.
76+
5577
To check the DNS server container/services creation logs, please tail the Docker logs. It may take up to 2 minutes for the racdns container to start completely.
5678

5779
```bash
58-
docker logs -f racdns
80+
docker logs -f rac-dnsserver
5981
```
6082

6183
you should see the following in docker logs output:
Binary file not shown.

OracleDatabase/RAC/OracleDNSServer/dockerfiles/buildContainerImage.sh

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#
77
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
88
#
9-
# Copyright (c) 2014,2021 Oracle and/or its affiliates.
9+
# Copyright (c) 2018-2024 Oracle and/or its affiliates.
1010
#
11-
11+
# shellcheck disable=SC2154
1212
usage() {
1313
cat << EOF
1414
@@ -17,7 +17,7 @@ It builds a container image for a DNS server
1717
1818
Parameters:
1919
-v: version to build
20-
Choose one of: $(for i in $(ls -d */); do echo -n "${i%%/} "; done)
20+
Choose one of: $(for i in */; do echo -n "${i%%/} "; done)
2121
-o: passes on container build option
2222
2323
LICENSE UPL 1.0
@@ -33,13 +33,15 @@ checksumPackages() {
3333
if hash md5sum 2>/dev/null; then
3434
echo "Checking if required packages are present and valid..."
3535
md5sum -c Checksum
36-
if [ "$?" -ne 0 ]; then
37-
echo "MD5 for required packages to build this image did not match!"
38-
echo "Make sure to download missing files in folder $VERSION."
39-
exit $?
36+
md5_exit_code=$?
37+
38+
if [ "$md5_exit_code" -ne 0 ]; then
39+
echo "MD5 for required packages to build this image did not match!"
40+
echo "Make sure to download missing files in folder $VERSION."
41+
exit "$md5_exit_code"
4042
fi
4143
else
42-
echo "Ignored MD5 sum, 'md5sum' command not available.";
44+
echo "Ignored MD5 sum, 'md5sum' command not available."
4345
fi
4446
}
4547

@@ -53,29 +55,27 @@ fi
5355

5456
# Parameters
5557
VERSION="latest"
56-
SKIPMD5=0
57-
DOCKEROPS=""
58+
DOCKEROPS=("${DOCKEROPS[@]}")
59+
PROXY_SETTINGS=("${PROXY_SETTINGS[@]}")
5860

59-
while getopts "hiv:o:" optname; do
61+
while getopts "h:v:o:" optname; do
6062
case "$optname" in
6163
"h")
6264
usage
6365
;;
64-
"i")
65-
SKIPMD5=1
66-
;;
6766
"v")
6867
VERSION="$OPTARG"
6968
;;
7069
"o")
71-
DOCKEROPS="$OPTARG"
70+
DOCKEROPS=("$OPTARG")
7271
;;
7372
"?")
74-
usage;
75-
exit 1;
73+
usage
74+
# shellcheck disable=SC2317
75+
exit 1
7676
;;
7777
*)
78-
# Should not occur
78+
# Should not occur
7979
echo "Unknown error while processing options inside buildDockerImage.sh"
8080
;;
8181
esac
@@ -85,32 +85,32 @@ done
8585
IMAGE_NAME="oracle/rac-dnsserver:$VERSION"
8686

8787
# Go into version folder
88-
cd $VERSION
88+
cd "$VERSION" || exit
89+
8990

9091
echo "=========================="
9192
echo "DOCKER info:"
9293
docker info
9394
echo "=========================="
9495

9596
# Proxy settings
96-
PROXY_SETTINGS=""
97-
if [ "${http_proxy}" != "" ]; then
98-
PROXY_SETTINGS="$PROXY_SETTINGS --build-arg http_proxy=${http_proxy}"
97+
if [ -n "${http_proxy-}" ]; then
98+
PROXY_SETTINGS+=("--build-arg http_proxy=${http_proxy}")
9999
fi
100100

101-
if [ "${https_proxy}" != "" ]; then
102-
PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}"
101+
if [ -n "${https_proxy-}" ]; then
102+
PROXY_SETTINGS+=("--build-arg https_proxy=${https_proxy}")
103103
fi
104104

105-
if [ "${ftp_proxy}" != "" ]; then
106-
PROXY_SETTINGS="$PROXY_SETTINGS --build-arg ftp_proxy=${ftp_proxy}"
105+
if [ -n "${ftp_proxy-}" ]; then
106+
PROXY_SETTINGS+=("--build-arg ftp_proxy=${ftp_proxy}")
107107
fi
108108

109-
if [ "${no_proxy}" != "" ]; then
110-
PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}"
109+
if [ -n "${no_proxy-}" ]; then
110+
PROXY_SETTINGS+=("--build-arg no_proxy=${no_proxy}")
111111
fi
112-
113-
if [ "$PROXY_SETTINGS" != "" ]; then
112+
# shellcheck disable=SC2128
113+
if [ -n "$PROXY_SETTINGS" ]; then
114114
echo "Proxy settings were found and will be used during the build."
115115
fi
116116

@@ -121,25 +121,19 @@ echo "Building image '$IMAGE_NAME' ..."
121121

122122
# BUILD THE IMAGE (replace all environment variables)
123123
BUILD_START=$(date '+%s')
124-
docker build --force-rm=true --no-cache=true $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f Dockerfile . || {
125-
echo "There was an error building the image."
126-
exit 1
127-
}
128-
BUILD_END=$(date '+%s')
129-
BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START`
130-
131-
echo ""
132-
133-
if [ $? -eq 0 ]; then
134-
cat << EOF
124+
if docker build --force-rm=true --no-cache=true "${DOCKEROPS[@]}" "${PROXY_SETTINGS[@]}" -t "$IMAGE_NAME" -f Dockerfile .; then
125+
BUILD_END=$(date '+%s')
126+
BUILD_ELAPSED=$((BUILD_END - BUILD_START))
127+
128+
cat << EOF
135129
Oracle Database Docker Image for Real Application Clusters (RAC) version $VERSION is ready to be extended:
136130
137131
--> $IMAGE_NAME
138132
139133
Build completed in $BUILD_ELAPSED seconds.
140134
141135
EOF
142-
143136
else
144-
echo "Oracle Database Real Application Clusters Docker Image was NOT successfully created. Check the output and correct any reported problems with the docker build operation."
145-
fi
137+
echo "There was an error building the image."
138+
exit 1
139+
fi

0 commit comments

Comments
 (0)