This step is similar to Step 3 except that the Oracle 19c database image (unlike the Oracle 12c database image) is pulled from the Github repository.
- Download the build files (images) for Oracle 19c from GitHub.
[root@19c-docker ~] # git clone https://github.com/marcelo-ocha/docker-images.git
- Download and copy the Oracle 19c database binaries to the location shown below.
[root@19c-docker ~] # pwd
/root/dockerimages/OracleDatabase/SingleInstance/dockerfiles/19.3.0
- Build the Docker images.
[root@19c-docker ~] #./buildDockerImage.sh -v 19.3.0 -e –I
- Push the 19c Docker images to the local private registry.
- [root@19c-docker ~] # docker run -d -p 5000:5000 --name registry -v /opt/registry/data:/var/lib/registry/ --restart always registry
- [root@19c-docker ~] # docker tag oracle/database:19.3.0-ee localhost:5000/ora19
- [root@19c-docker ~] # docker push localhost:5000/ora19
- On the host operating system, to ensure persistence, create named Docker volumes.
[root@19c-docker ~] # docker volume create --driver local --opt type=none --opt device=/home/oracle/ --opt o=bind test
[root@19c-docker ~] # docker volume create -d local -o Mountpoint=/home/oracle --name=test
- Create any necessary groups and users.
- [root@19c-docker oracle] # groupadd -g 54321 oinstall
- [root@19c-docker oracle] # groupadd -g 54322 dba
- [root@19c-docker oracle] # useradd -u 54321 -g oinstall -G dba oracle
- On the local host, we are hosting database files in the /home/oracle directory. To avoid permissions issues from subsequent commands, change the permissions of this directory.
- [root@19c-docker oracle] # chown -R oracle: dba /home/oracle
- [root@19c-docker oracle] # chmod -R 777 /home/oracle
- Run the container.
[root@19c-docker ~] #docker run -d --name database19c -p 1521:1521 -p 5500:5500 -e ORACLE_SID=ORCLCDB -e ORACLE_PDB=orclpdb1 -e ORACLE_PWD=oracle -v test:/ORCL localhost:5000/ora12c
- Log in to the 19c container.
[root@19c-docker ~] # docker exec -it d9a40ee6ca10 bash
[oracle@d9a40ee6ca10 ~] $ sqlplus "/ as sysdba"