preface
I need to build Oracle19c version for testing in these two days. I found that if I searched online or docker Hub, there were basically sath89/ Oracle12c or BFOM/Oracle-12C mirrors, but no one had made Oracle19c mirrors. I thought, Oracle must have had an offical(official mirror) of their own, so I went looking for it, but it didn’t. Oracle officially does not allow private use of its database to create a pull or run Docker image. If it exists on docker Hub, it is estimated that Oracle law firm has warned to delete it. However, there is still a solution to make Docker Oracle image.
Oracle official docker image process
1. Download a dockfile written by Oracle
git clonehttps://github.com/oracle/docker-images.git this scripting tool contains many versions of the mirror My iscloneTo: / media/liuxu/data/Leonard/tools/oracle19cCopy the code
2. Download the Oracle zip file (if you have more than one, download more than one)
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html this address contains the version 11.2-19 c, if you want to find before, please pull in the end: Previous Database Release Software, to findCopy the code
3. Copy the downloaded ZIP file to the dockfile directory
cp ~/Downloads/LINUX.X64_193000_db_home.zip / media/liuxu/data/Leonard/tools/oracle19c/docker - images/OracleDatabase SingleInstance/dockerfiles 19.3.0 / note: Look at your database version and copy it to the corresponding version folderCopy the code
4. Run the following command to create a Docker image
$ cd/media/liuxu/data/leonard/tools/oracle19c/docker-images/OracleDatabase/SingleInstance/dockerfiles $ . / buildDockerImage. Sh 19.3.0 - v-eNote: This step is a long wait. It's only half an hour. Output information is too much, I will not paste!Copy the code
Final output log: Changing groupname of /opt/oracle/oraInventory to dba. The execution of the script is complete. Check /opt/oracle/product/19c/dbhome_1/install/root_b26c57265eb5_2019-11-06_05-08-00-978749653.logfor the output of root script
Removing intermediate container b26c57265eb5
---> 05ead40e7f4e
Step 18/23 : USER oracle
---> Running in 6d577e76fba0
Removing intermediate container 6d577e76fba0
---> a51d59624aaf
Step 19/23 : WORKDIR /home/oracle
---> Running in 5114f387b868
Removing intermediate container 5114f387b868
---> 15f8e332761c
Step 20/23 : VOLUME ["$ORACLE_BASE/oradata"]
---> Running in bacecd10e611
Removing intermediate container bacecd10e611
---> ddbbf7bd1071
Step 21/23 : EXPOSE 1521 5500
---> Running in cf58f4f7a5ef
Removing intermediate container cf58f4f7a5ef
---> 4ea9a2715652
Step 22/23 : HEALTHCHECK --interval=1m --start-period=5m CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1
---> Running in a63ca1e440ee
Removing intermediate container a63ca1e440ee
---> 6dfd61e0006a
Step 23/23 : CMD exec $ORACLE_BASE/$RUN_FILE
---> Running in 45122cd289f3
Removing intermediate container 45122cd289f3
---> c592b9cb2a9c
Successfully built c592b9cb2a9c
Successfully tagged oracle/database:19.3.0-ee
Oracle Database Docker Image for 'ee'Version 19.3.0 is Ready to be extended: --> Oracle/Database :19.3.0- EE Build completedin 919 seconds.
Copy the code
Detailed you can refer to this: docker – images/OracleDatabase SingleInstance/README. Md this inside speak very carefully (or this:Github.com/oracle/dock…)
5. Start
docker run --name oracle19c \ -p 1521:1521 \ -p 5500:5500 \ -v / media/liuxu/data/Leonard/tools/oracle19c/oracle19c - data: / opt/oracle/oradata \ oracle database: 19.3.0 - ee pay attention to the first line of log: oracle PASSWORD FOR SYS, SYSTEM AND PDBADMIN: iV86pmS7ZxI=1 iV86pmS7ZxI=1Copy the code
6. After that, you can use the software to log in to Oracle
Reference links:www.dbform.com/2019/05/06/…
The problem
I encountered this problem when starting the container:
Cannot create directory "/opt/oracle/oradata/ORCLCDB"Problem: because, you mount out, then Docker must be written to the path you mount, and then, there is no write permission. Solution is: give a written permission, I use: sudo chmod 777 - R/media/liuxu/data/Leonard/tools/oracle19c/oracle19c - data (a little violence)Copy the code