oracle 19c on docker
## get docker images
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#license-lightbox
## git clone oracle docker
[root@localhost ~]# git clone https://github.com/oracle/docker-images
Cloning into 'docker-images'...
remote: Enumerating objects: 12757, done.
remote: Total 12757 (delta 0), reused 0 (delta 0), pack-reused 12757
Receiving objects: 100% (12757/12757), 9.53 MiB | 3.93 MiB/s, done.
Resolving deltas: 100% (7520/7520), done.
[root@localhost ~]# ll
합계 12
-rw-------. 1 root root 1696 5월 12 09:45 anaconda-ks.cfg
drwxr-xr-x. 23 root root 4096 10월 15 22:08 docker-images
-rw-r--r--. 1 root root 1744 5월 21 12:06 initial-setup-ks.cfg
[root@localhost ~]# cd docker-images/
[root@localhost docker-images]# ll
합계 24
drwxr-xr-x. 6 root root 110 10월 15 22:08 Archive
-rw-r--r--. 1 root root 760 10월 15 22:08 CODEOWNERS
-rw-r--r--. 1 root root 9371 10월 15 22:08 CONTRIBUTING.md
drwxr-xr-x. 3 root root 53 10월 15 22:08 Contrib
drwxr-xr-x. 3 root root 16 10월 15 22:08 GraalVM
-rw-r--r--. 1 root root 1844 10월 15 22:08 LICENSE
drwxr-xr-x. 10 root root 169 10월 15 22:08 NoSQL
drwxr-xr-x. 3 root root 74 10월 15 22:08 OracleBI
drwxr-xr-x. 3 root root 44 10월 15 22:08 OracleCloudInfrastructure
drwxr-xr-x. 5 root root 101 10월 15 22:08 OracleCoherence
drwxr-xr-x. 4 root root 71 10월 15 22:08 OracleDatabase
drwxr-xr-x. 4 root root 72 10월 15 22:08 OracleFMWInfrastructure
drwxr-xr-x. 3 root root 137 10월 15 22:08 OracleGoldenGate
drwxr-xr-x. 4 root root 89 10월 15 22:08 OracleHTTPServer
drwxr-xr-x. 3 root root 42 10월 15 22:08 OracleInstantClient
drwxr-xr-x. 6 root root 62 10월 15 22:08 OracleJava
drwxr-xr-x. 4 root root 63 10월 15 22:08 OracleLinuxDevelopers
drwxr-xr-x. 4 root root 43 10월 15 22:08 OracleOpenJDK
drwxr-xr-x. 3 root root 92 10월 15 22:08 OracleRestDataServices
drwxr-xr-x. 4 root root 91 10월 15 22:08 OracleSOASuite
drwxr-xr-x. 3 root root 74 10월 15 22:08 OracleWebCenterSites
drwxr-xr-x. 4 root root 89 10월 15 22:08 OracleWebLogic
-rw-r--r--. 1 root root 2563 10월 15 22:08 README.md
[root@localhost docker-images]# cd OracleDatabase/
[root@localhost OracleDatabase]#
[root@localhost OracleDatabase]# ll
합계 8
-rw-r--r--. 1 root root 1865 10월 15 22:08 LICENSE
drwxr-xr-x. 5 root root 121 10월 15 22:08 RAC
-rw-r--r--. 1 root root 878 10월 15 22:08 README.md
drwxr-xr-x. 7 root root 166 10월 15 22:08 SingleInstance
[root@localhost OracleDatabase]# cd SingleInstance/
[root@localhost SingleInstance]# ll
합계 36
-rw-r--r--. 1 root root 1095 10월 15 22:08 COPYRIGHT
-rw-r--r--. 1 root root 7103 10월 15 22:08 FAQ.md
-rw-r--r--. 1 root root 1865 10월 15 22:08 LICENSE
-rw-r--r--. 1 root root 16132 10월 15 22:08 README.md
drwxr-xr-x. 3 root root 23 10월 15 22:08 charts
drwxr-xr-x. 8 root root 123 10월 15 22:08 dockerfiles
drwxr-xr-x. 3 root root 65 10월 15 22:08 extensions
drwxr-xr-x. 12 root root 238 10월 15 22:08 samples
drwxr-xr-x. 3 root root 4096 10월 15 22:08 tests
[root@localhost SingleInstance]# cd dockerfiles/
[root@localhost dockerfiles]# ll
합계 24
drwxr-xr-x. 2 root root 126 10월 15 22:08 11.2.0.2
drwxr-xr-x. 2 root root 4096 10월 15 22:08 12.1.0.2
drwxr-xr-x. 2 root root 4096 10월 15 22:08 12.2.0.1
drwxr-xr-x. 2 root root 4096 10월 15 22:08 18.3.0
drwxr-xr-x. 2 root root 140 10월 15 22:08 18.4.0
drwxr-xr-x. 2 root root 4096 10월 15 22:19 19.3.0
-rwxr-xr-x. 1 root root 5882 10월 15 22:08 buildDockerImage.sh
[root@localhost dockerfiles]# ll 19.3.0/
합계 2988072
-rw-r--r--. 1 root root 63 10월 15 22:08 Checksum.ee
-rw-r--r--. 1 root root 63 10월 15 22:08 Checksum.se2
-rw-r--r--. 1 root root 4052 10월 15 22:08 Dockerfile
-rw-r--r--. 1 root root 3059705302 10월 15 18:14 LINUX.X64_193000_db_home.zip
-rwxr-xr-x. 1 root root 1050 10월 15 22:08 checkDBStatus.sh
-rwxr-xr-x. 1 root root 905 10월 15 22:08 checkSpace.sh
-rwxr-xr-x. 1 root root 3102 10월 15 22:08 createDB.sh
-rw-r--r--. 1 root root 6878 10월 15 22:08 db_inst.rsp
-rw-r--r--. 1 root root 9204 10월 15 22:08 dbca.rsp.tmpl
-rwxr-xr-x. 1 root root 2656 10월 15 22:08 installDBBinaries.sh
-rw-r--r--. 1 root root 1941 10월 15 22:08 relinkOracleBinary.sh
-rwxr-xr-x. 1 root root 6712 10월 15 22:08 runOracle.sh
-rwxr-xr-x. 1 root root 1015 10월 15 22:08 runUserScripts.sh
-rwxr-xr-x. 1 root root 758 10월 15 22:08 setPassword.sh
-rwxr-xr-x. 1 root root 932 10월 15 22:08 setupLinuxEnv.sh
-rwxr-xr-x. 1 root root 678 10월 15 22:08 startDB.sh
[root@localhost dockerfiles]#
## build docker
[root@localhost dockerfiles]# ./buildDockerImage.sh -v 19.3.0 -s
Checking Docker version.
Checking if required packages are present and valid...
LINUX.X64_193000_db_home.zip: 성공
==========================
DOCKER info:
Client:
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 19.03.13
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-1127.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.675GiB
Name: localhost.localdomain
ID: QJUM:3LZO:EPRG:LKXF:6OB6:KJ7V:6I24:TVGF:MAMM:3TCU:IJH3:5ATZ
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
==========================
Building image 'oracle/database:19.3.0-se2' ...
Sending build context to Docker daemon 1.573GB
## build images
[root@localhost dockerfiles]# ./buildDockerImage.sh -v 19.3.0 -s
Checking Docker version.
Checking if required packages are present and valid...
LINUX.X64_193000_db_home.zip: 성공
==========================
DOCKER info:
Client:
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 19.03.13
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-1127.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.612GiB
Name: localhost.localdomain
ID: L36D:LMSQ:VB2G:76TT:O2GA:Y2B7:22KS:WLG2:JOQX:KX52:YKKC:Y7LF
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
==========================
Building image 'oracle/database:19.3.0-se2' ...
Sending build context to Docker daemon 3.06GB
Step 1/22 : FROM oraclelinux:7-slim as base
7-slim: Pulling from library/oraclelinux
41152c08460e: Pull complete
Digest: sha256:f5969916ad1da0108a0503d910273c08d92b807cd14bf9ae79d83c93d8fe5b34
Status: Downloaded newer image for oraclelinux:7-slim
---> 2280c7aa0c96
Step 2/22 : LABEL "provider"="Oracle" "issues"="https://github.com/oracle/docker-images/issues" "volume.data"="/opt/oracle/oradata" "volume.setup.location1"="/opt/oracle/scripts/setup" "volume.setup.location2"="/docker-entrypoint-initdb.d/setup" "volume.startup. location1"="/opt/oracle/scripts/startup" "volume.startup.location2"="/docker-entrypoint-initdb.d/startup" "port.listener"="1521" "port.oemexpress"="5500"
---> Running in 3ef13abd8475
Removing intermediate container 3ef13abd8475
---> 5094d1c5d169
Step 3/22 : ARG SLIMMING=true
---> Running in fcdde8f9cabc
Removing intermediate container fcdde8f9cabc
---> 6fff6165a56c
Step 4/22 : ENV ORACLE_BASE=/opt/oracle ORACLE_HOME=/opt/oracle/product/19c/dbhome_1 INSTALL_DIR=/opt/install INSTALL_FILE_1="LINUX.X64_193000_db_home.zip" INSTALL_RSP="db_inst.rsp" CONFIG_RSP="dbca.rsp.tmpl" PWD_FILE="setPassword.sh" RUN_FILE="runOracle.sh" START_FILE="startDB.sh" CREATE_DB_FILE="createDB.sh" SETUP_LINUX_FILE="setupLinuxEnv.sh" CH ECK_SPACE_FILE="checkSpace.sh" CHECK_DB_FILE="checkDBStatus.sh" USER_SCRIPTS_FILE="runUserScripts.sh" INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" RELINK_BINARY_FILE="relinkOracl eBinary.sh" SLIMMING=$SLIMMING
---> Running in 01eaea31156c
Removing intermediate container 01eaea31156c
---> ee1d86be56a9
Step 5/22 : ENV PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch/:/usr/sbin:$PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
---> Running in f66785b02a23
Removing intermediate container f66785b02a23
---> 9bff33fdb467
Step 6/22 : COPY $SETUP_LINUX_FILE $CHECK_SPACE_FILE $INSTALL_DIR/
---> 2a2e3b6d111c
Step 7/22 : COPY $RUN_FILE $START_FILE $CREATE_DB_FILE $CONFIG_RSP $PWD_FILE $CHECK_DB_FILE $USER_SCRIPTS_FILE $RELINK_BINARY_FILE $ORACLE_BASE/
---> bc24cbb1fc5d
Step 8/22 : RUN chmod ug+x $INSTALL_DIR/*.sh && sync && $INSTALL_DIR/$CHECK_SPACE_FILE && $INSTALL_DIR/$SETUP_LINUX_FILE && rm -rf $INSTALL_DIR
---> Running in 732e1cbb8d24
Loaded plugins: ovl
Resolving Dependencies
--> Running transaction check
---> Package openssl.x86_64 1:1.0.2k-19.0.1.el7 will be installed
--> Processing Dependency: make for package: 1:openssl-1.0.2k-19.0.1.el7.x86_64
---> Package oracle-database-preinstall-19c.x86_64 0:1.0-2.el7 will be installed
--> Processing Dependency: binutils for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64
--> Processing Dependency: bc for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64
--> Processing Dependency: initscripts for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64
--> Processing Dependency: sysstat for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64
--> Processing Dependency: xorg-x11-utils for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64
--> Processing Dependency: bind-utils for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64
--> Processing Dependency: net-tools for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64
--> Processing Dependency: pam for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64
--> Processing Dependency: compat-libcap1 for package: oracle-database-preinstall-19c-1.0-
Changing groupname of /opt/oracle/oraInventory to dba.
The execution of the script is complete.
Check /opt/oracle/product/19c/dbhome_1/install/root_c98a519d7530_2020-10-16_01-49-05-197076680.log for the output of root script
Removing intermediate container c98a519d7530
---> bca1d94fcab3
Step 19/22 : USER oracle
---> Running in c0a165f11fa3
Removing intermediate container c0a165f11fa3
---> 4324c7d25c20
Step 20/22 : WORKDIR /home/oracle
---> Running in a9d2f0095880
Removing intermediate container a9d2f0095880
---> 828e7e65a468
Step 21/22 : HEALTHCHECK --interval=1m --start-period=5m CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1
---> Running in b213f3e08b8f
Removing intermediate container b213f3e08b8f
---> b81b596aa6c6
Step 22/22 : CMD exec $ORACLE_BASE/$RUN_FILE
---> Running in 65cc9d1ea3df
Removing intermediate container 65cc9d1ea3df
---> 0b287b20891a
Successfully built 0b287b20891a
Successfully tagged oracle/database:19.3.0-se2
Oracle Database Docker Image for 'se2' version 19.3.0 is ready to be extended:
--> oracle/database:19.3.0-se2
Build completed in 1719 seconds.
[root@localhost dockerfiles]#
## build images
[root@localhost dockerfiles]# docker run --name oracle19c -p 1521:1521 -p 5500:5500 -e ORACLE_PDB=orcl -e ORACLE_PWD=password -e ORACLE_MEM=4000 -v /opt/oracle/oradata -d oracle/database:19.3.0-se2
37db6a144c17dbf7f32015f0c6b21cca276808b6b33f1ace416ea47c50818654
[root@localhost dockerfiles]#
[root@localhost dockerfiles]# docker run --name oracle19c -p 1521:1521 -p 5500:5500 -e ORACLE_PDB=orcl -e ORACLE_
37db6a144c17dbf7f32015f0c6b21cca276808b6b33f1ace416ea47c50818654
[root@localhost dockerfiles]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
37db6a144c17 oracle/database:19.3.0-se2 "/bin/sh -c 'exec $O…" 21 seconds ago Up 17 seconds (heal
[root@localhost dockerfiles]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
37db6a144c17 oracle/database:19.3.0-se2 "/bin/sh -c 'exec $O…" 32 minutes ago Up 32 minutes (heal
[root@localhost dockerfiles]# systemctl stop firewalld
[root@localhost dockerfiles]# docker exec -it oracle19 /bin/bash
Error: No such container: oracle19
[root@localhost dockerfiles]# docker exec -it oracle19c /bin/bash
[oracle@37db6a144c17 ~]$ sqlplus sys/${password}@orcl as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Oct 16 04:35:44 2020
Version 19.3.0.0.0
댓글
댓글 쓰기