# Oracle
## Building Oracle Database container images
IMPORTANT: You will have to provide the installation binaries of Oracle Database (except for Oracle Database 18c XE and 21c XE) 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, make sure you use the linux link: Linux x86-64. The needed file is named linuxx64_<version>_database.zip. You also have to make sure to have internet connectivity for yum. Note that you must not uncompress the binaries. The script will handle that for you and fail if you uncompress them manually!
Before you build the image make sure that you have provided the installation binaries and put them into the right folder. Once you have chosen which edition and version you want to build an image of, go into the dockerfiles folder and run the buildContainerImage.sh script:
1. Download binary
2. Move the binary to experiments/oracle/dockerfiles/<version> (DONT UNZIP IT)
3. Run `./buildContainerImage.sh -v <version> -s -t <your-image-tag>`
4. Run `./buildFastBoot.sh -i my-oracle-image -o dev-clone.redgate-platform.com:9632/oracle/database:<version> -s ORCLCDB`
5. Login to Docker container
```
url=dev-clone.redgate-platform.com
dockerSecret=$(kubectl get secret docker-secret -n redgate-clone-data -o jsonpath='{.data}')
dockerAuth=$(echo $dockerSecret | yq -r '.".dockerconfigjson"' | base64 -d | yq -r ".auths.\"$url:9632\"")
username=$(echo $dockerAuth | yq -r .username)
password=$(echo $dockerAuth | yq -r .password)
echo $password | sudo docker login $url:9632 --username $username --password-stdin
```
6. Push it inside the cluster:
```
docker push dev-clone.redgate-platform.com:9632/oracle/database:<version>
```
P.S:
```
Clive has uploaded the built Oracle image in our cloningcapability SMB fileshare.
Instead of building a new one every single time, which is time consuming,
Simply go to Microsoft Azure Data Explorer app, generate a one time URL,
then download the oracle image (see https://redgate.slack.com/archives/C02DH4NKSPM/p1666343712979049)
Finally, run:
```
sudo docker load --input oracle
```
```