docker 安装oracle 19C
最近有个需求,客户环境安装oracle数据库安装不上,想到用docker的方式制作好oracle镜像然后传到客户的机器上直接用docker跑oracle下面是大概流程记录一下

安装oracle19cdocker的版本必须在17以上
Docker version is below the minimum required version 17.09
Please upgrade your Docker installation to proceed.


卸载原来yum安装的docker
systemctl stop docker.service
yum remove -y docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine

安装docker
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
 
yum -y install docker-ce docker-ce-cli containerd.io
[root@VM-16-86-centos dockerfiles]# docker -v
Docker version 20.10.8, build 3967b7d



1.创建目录下载镜像
[root@VM-16-86-centos ~]# mkdir /oracle 
[root@VM-16-86-centos ~]# cd /oracle
[root@VM-16-86-centos oracle]# git clone https://github.com/oracle/docker-images.git
Cloning into 'docker-images'...
remote: Enumerating objects: 14389, done.
remote: Counting objects: 100% (403/403), done.
remote: Compressing objects: 100% (272/272), done.
remote: Total 14389 (delta 171), reused 313 (delta 115), pack-reused 13986
Receiving objects: 100% (14389/14389), 10.04 MiB | 96.00 KiB/s, done.
Resolving deltas: 100% (8429/8429), done.

[root@VM-16-86-centos oracle]# ll
total 4
drwxr-xr-x 30 root root 4096 Aug 14 12:37 docker-images
[root@VM-16-86-centos oracle]#   cd /docker-images/OracleDatabase/SingleInstance/dockerfiles/
[root@VM-16-86-centos docker-images]# ll
total 32
drwxr-xr-x 2 root root 4096 Aug 14 12:37 11.2.0.2
drwxr-xr-x 2 root root 4096 Aug 14 12:37 12.1.0.2
drwxr-xr-x 2 root root 4096 Aug 14 12:37 12.2.0.1
drwxr-xr-x 2 root root 4096 Aug 14 12:37 18.3.0
drwxr-xr-x 2 root root 4096 Aug 14 12:37 18.4.0
drwxr-xr-x 2 root root 4096 Aug 14 12:37 19.3.0
-rwxr-xr-x 1 root root 6953 Aug 14 12:37 buildContainerImage.sh

buildDockerImage.sh  文件可以制作镜像
我们看到是存在19.3.0的dockerfile的,同时检查其安装的安装包文件名:
[root@VM-16-86-centos dockerfiles]# cd  19.3.0
[root@VM-16-86-centos 19.3.0]# ll
total 84
-rwxr-xr-x 1 root root 1040 Aug 14 12:37 checkDBStatus.sh
-rwxr-xr-x 1 root root  898 Aug 14 12:37 checkSpace.sh
-rw-r--r-- 1 root root   63 Aug 14 12:37 Checksum.ee
-rw-r--r-- 1 root root   63 Aug 14 12:37 Checksum.se2
-rwxr-xr-x 1 root root 6375 Aug 14 12:37 createDB.sh
-rw-r--r-- 1 root root 9204 Aug 14 12:37 dbca.rsp.tmpl
-rw-r--r-- 1 root root 6878 Aug 14 12:37 db_inst.rsp
-rw-r--r-- 1 root root 4336 Aug 14 12:37 Dockerfile
-rwxr-xr-x 1 root root 2656 Aug 14 12:37 installDBBinaries.sh
-rw-r--r-- 1 root root 1967 Aug 14 12:37 relinkOracleBinary.sh
-rwxr-xr-x 1 root root 7453 Aug 14 12:37 runOracle.sh
-rwxr-xr-x 1 root root 1015 Aug 14 12:37 runUserScripts.sh
-rwxr-xr-x 1 root root  785 Aug 14 12:37 setPassword.sh
-rwxr-xr-x 1 root root 1035 Aug 14 12:37 setupLinuxEnv.sh
-rwxr-xr-x 1 root root  678 Aug 14 12:37 startDB.sh
[root@VM-16-86-centos 19.3.0]#  cat Dockerfile|grep INSTALL_FILE_1
    INSTALL_FILE_1="LINUX.X64_193000_db_home.zip" \
COPY --chown=oracle:dba $INSTALL_FILE_1 $INSTALL_RSP $INSTALL_DB_BINARIES_FILE $INSTALL_DIR/

2. 将安装包拷贝到该目录下,运行开始安装:
需要提前下载Oracle安装介质,文件名默认是不需要更改的,应该是LINUX.X64_193000_db_home.zip,然后将其复制到对应版本的目录下即可。

[root@VM-16-86-centos 19.3.0]# ll
total 2988084
-rwxr-xr-x 1 root root       1040 Aug 14 12:37 checkDBStatus.sh
-rwxr-xr-x 1 root root        898 Aug 14 12:37 checkSpace.sh
-rw-r--r-- 1 root root         63 Aug 14 12:37 Checksum.ee
-rw-r--r-- 1 root root         63 Aug 14 12:37 Checksum.se2
-rwxr-xr-x 1 root root       6375 Aug 14 12:37 createDB.sh
-rw-r--r-- 1 root root       9204 Aug 14 12:37 dbca.rsp.tmpl
-rw-r--r-- 1 root root       6878 Aug 14 12:37 db_inst.rsp
-rw-r--r-- 1 root root       4336 Aug 14 12:37 Dockerfile
-rwxr-xr-x 1 root root       2656 Aug 14 12:37 installDBBinaries.sh
-rw-r--r-- 1 root root 3059705302 Aug 17  2019 LINUX.X64_193000_db_home.zip   -----------需要上传
-rw-r--r-- 1 root root       1967 Aug 14 12:37 relinkOracleBinary.sh
-rwxr-xr-x 1 root root       7453 Aug 14 12:37 runOracle.sh
-rwxr-xr-x 1 root root       1015 Aug 14 12:37 runUserScripts.sh
-rwxr-xr-x 1 root root        785 Aug 14 12:37 setPassword.sh
-rwxr-xr-x 1 root root       1035 Aug 14 12:37 setupLinuxEnv.sh
-rwxr-xr-x 1 root root        678 Aug 14 12:37 startDB.sh


[root@VM-16-86-centos dockerfiles]# ./buildContainerImage.sh  -v 19.3.0 -e 


Removing intermediate container 826420d25096
 ---> 82192fd0a0b1
Successfully built 82192fd0a0b1
Successfully tagged oracle/database:19.3.0-ee


  Oracle Database container image for 'ee' version 19.3.0 is ready to be extended: 
    
    --> oracle/database:19.3.0-ee

  Build completed in 792 seconds.
  
 当出现上面的提示,就表示镜像制作完成了,剩下就是利用该镜像启动容器即可。

3. 启动容器:安装数据库

启动容器
[root@VM-16-86-centos dockerfiles]# docker images
REPOSITORY                   TAG         IMAGE ID       CREATED          SIZE
oracle/database              19.3.0-ee   82192fd0a0b1   13 minutes ago   6.53GB
oraclelinux                  7-slim      0a28ba78f4c9   8 weeks ago      132MB



---简易启动不挂载本地目录
[root@docker dockerfiles]# docker run --name oracle-19c-test -p 1521:1521 -p 5500:5500 -e ORACLE_SID=ora19c -e ORACLE_PDB=test -e ORACLE_PWD=oracle   oracle/database:19.3.0-ee

 100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/ORA19C.
Database Information:
Global Database Name:ORA19C
System Identifier(SID):ORA19C
 

登陆主机或数据库进行操作:

[root@VM-16-86-centos overlay2]# docker exec -it oracle-19c-test bash
[oracle@a3ac36cf068a dbs]$ export ORACLE_SID=ORA19C
[oracle@a3ac36cf068a dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Aug 14 06:50:07 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 TEST                           READ WRITE NO
SQL> 

SQL> alter session set container=test;

Session altered.

SQL> create user test identified by test;

User created.

SQL> grant dba to test;

Grant succeeded.


lsnr[oracle@a3ac36cf068a dbs]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-AUG-2021 06:53:26

Copyright (c) 1991, 2019, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                14-AUG-2021 06:14:19
Uptime                    0 days 0 hr. 39 min. 6 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/a3ac36cf068a/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=a3ac36cf068a)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/ORA19C/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "ORA19C" has 1 instance(s).
  Instance "ORA19C", status READY, has 1 handler(s) for this service...
Service "ORA19CXDB" has 1 instance(s).
  Instance "ORA19C", status READY, has 1 handler(s) for this service...
Service "c9801174d7950c41e053020011acf687" has 1 instance(s).
  Instance "ORA19C", status READY, has 1 handler(s) for this service...
Service "test" has 1 instance(s).
  Instance "ORA19C", status READY, has 1 handler(s) for this service...
The command completed successfully

至此就完成了docker安装Oracle 19c!对于测试、试验非常方便~


--测试远程连接test库的test用户
 sqlplus test/test@81.70.199.168:1521/test
-----登陆em
https://81.70.199.168:5500/em

###################  
注意:/oracle/oradata目录权限一定要正确,在容器中oracle用户的uid是54321,所以要保证容器内的oracle用户有权限读写该目录。
如创建oracle用户且uid是54321:
容器内的用户id如下
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)


groupadd -g 54321 oinstall 
groupadd -g 54322 dba
groupadd -g 54323 oper 
useradd -u 54321 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle 
echo "oracle" | passwd --stdin oracle

chown oracle:oinstall /data/oracle

useradd -u 54321 -g oinstall -G dba oracle	

注:如果"DATABASE IS READY TO USE!"提示信息,表示数据库已成功安装了。
注意:oracle 企业版的docker run的命令格式如下(XE版的都有所区别):
创建本机挂载目录
[root@VM-16-86-centos ]# mkdir - p /data/oracle
[root@VM-16-86-centos ~]# chmod 775 /data/oracle

----指定挂载本地目录启动 加-v参数,-p宿主机的1522映射容器的1521端口,
[root@docker dockerfiles]#docker run --name oracle-19c -p 1522:1521 -p 5501:5500 -e ORACLE_SID=orcl -e ORACLE_PDB=pdb1 -e ORACLE_PWD=oracle -v /data/oracle:/opt/oracle/oradata oracle/database:19.3.0-ee

过程日志报错:
mkdir: cannot create directory '/opt/oracle/oradata/dbconfig': Permission denied
mv: cannot stat '/opt/oracle/product/19c/dbhome_1/dbs/spfileORCL.ora': No such file or directory
mv: cannot stat '/opt/oracle/product/19c/dbhome_1/dbs/orapwORCL': No such file or directory
mv: cannot move '/opt/oracle/product/19c/dbhome_1/network/admin/sqlnet.ora' to '/opt/oracle/oradata/dbconfig/ORCL/': No such file or directory
mv: cannot move '/opt/oracle/product/19c/dbhome_1/network/admin/listener.ora' to '/opt/oracle/oradata/dbconfig/ORCL/': No such file or directory
mv: cannot move '/opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora' to '/opt/oracle/oradata/dbconfig/ORCL/': No such file or directory
mv: cannot move '/opt/oracle/product/19c/dbhome_1/install/.docker_enterprise' to '/opt/oracle/oradata/dbconfig/ORCL/': No such file or directory
cp: cannot create regular file '/opt/oracle/oradata/dbconfig/ORCL/': No such file or directory
ln: failed to create symbolic link '/opt/oracle/product/19c/dbhome_1/network/admin/sqlnet.ora': File exists
ln: failed to create symbolic link '/opt/oracle/product/19c/dbhome_1/network/admin/listener.ora': File exists
ln: failed to create symbolic link '/opt/oracle/product/19c/dbhome_1/network/admin/tnsnames.ora': File exists
cp: cannot stat '/opt/oracle/oradata/dbconfig/ORCL/oratab': No such file or directory

[root@VM-16-86-centos ~]# docker exec -it oracle-19c bash
[oracle@5510962e1ad2 /]$ cd /opt
[oracle@5510962e1ad2 opt]$ cd oracle
[oracle@5510962e1ad2 oracle]$ ll
total 92
drwxr-x--- 3 oracle oinstall 4096 Aug 14 07:16 admin
drwxr-x--- 2 oracle oinstall 4096 Aug 14 07:16 audit
drwxr-x--- 3 oracle oinstall 4096 Aug 14 07:16 cfgtoollogs
-rwxr-xr-x 1 oracle dba      1040 Aug 14 04:37 checkDBStatus.sh
drwxr-xr-x 2 oracle dba      4096 Aug 14 05:36 checkpoints
-rwxr-xr-x 1 oracle dba      6375 Aug 14 04:37 createDB.sh
-rw-r--r-- 1 oracle dba      9204 Aug 14 04:37 dbca.rsp.tmpl
drwxrwxr-x 1 oracle dba      4096 Aug 14 05:36 diag
drwxrwx--- 1 oracle dba      4096 Aug 14 07:16 oraInventory
drwxrwxr-x 2 root   root     4096 Aug 14 05:53 oradata
drwxr-xr-x 1 oracle dba      4096 Aug 14 05:28 product
-rwxr-xr-- 1 oracle dba      1967 Aug 14 04:37 relinkOracleBinary.sh
-rwxr-xr-x 1 oracle dba      7453 Aug 14 04:37 runOracle.sh
-rwxr-xr-x 1 oracle dba      1015 Aug 14 04:37 runUserScripts.sh
drwxr-xr-x 1 oracle dba      4096 Aug 14 05:28 scripts
-rwxr-xr-x 1 oracle dba       785 Aug 14 04:37 setPassword.sh
-rwxr-xr-x 1 oracle dba       678 Aug 14 04:37 startDB.sh

oradata的属主为root:root在宿主机上创建oracle用户,更改/data/oracle的属主为oracle:oinstall

groupadd -g 3000 oinstall 
groupadd -g 3300 dba
groupadd -g 3301 oper 
useradd -u 54321 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle 
echo "oracle" | passwd --stdin oracle

chown oracle:oinstall /data/oracle


重新运行docker
[root@docker dockerfiles]#docker run --name oracle-19c -p 1522:1521 -p 5501:5500 -e ORACLE_SID=orcl -e ORACLE_PDB=pdb1 -e ORACLE_PWD=oracle -v /data/oracle:/opt/oracle/oradata oracle/database:19.3.0-ee


[root@VM-16-86-centos data]# docker exec -it oracle-19c bash
[oracle@445c7227f000 ~]$ cd /opt/oracle
[oracle@445c7227f000 oracle]$ ll
total 104
drwxr-x--- 3 oracle oinstall 4096 Aug 14 07:34 admin
drwxr-x--- 2 oracle oinstall 4096 Aug 14 07:34 audit
drwxr-x--- 3 oracle oinstall 4096 Aug 14 07:34 cfgtoollogs
-rwxr-xr-x 1 oracle dba      1040 Aug 14 04:37 checkDBStatus.sh
drwxr-xr-x 2 oracle dba      4096 Aug 14 05:36 checkpoints
-rwxr-xr-x 1 oracle dba      6375 Aug 14 04:37 createDB.sh
-rw-r--r-- 1 oracle oinstall 9111 Aug 14 07:34 dbca.rsp
-rw-r--r-- 1 oracle dba      9204 Aug 14 04:37 dbca.rsp.tmpl
drwxrwxr-x 1 oracle dba      4096 Aug 14 05:36 diag
drwxrwx--- 1 oracle dba      4096 Aug 14 07:34 oraInventory
drwxrwxr-x 3 oracle     3000 4096 Aug 14 07:34 oradata

#########################
将容器当前运行状态做成镜像
[root@VM-16-86-centos data]# docker ps
CONTAINER ID   IMAGE                       COMMAND                  CREATED             STATUS                            PORTS                                                                                  NAMES
445c7227f000   oracle/database:19.3.0-ee   "/bin/sh -c 'exec $O…"   6 minutes ago       Up 6 minutes (health: starting)   0.0.0.0:1522->1521/tcp, :::1522->1521/tcp, 0.0.0.0:5501->5500/tcp, :::5501->5500/tcp   oracle-19c
a3ac36cf068a   oracle/database:19.3.0-ee   "/bin/sh -c 'exec $O…"   About an hour ago   Up About an hour (healthy)        0.0.0.0:1521->1521/tcp, :::1521->1521/tcp, 0.0.0.0:5500->5500/tcp, :::5500->5500/tcp   oracle-19c-test



将容器打包成镜像
-a 为作者
-m 为描述信息 
b2a3d7b67722 运行中的容器的ID

docker commit -a "guan" -m "oracle19c" 容器名称或id 打包的镜像名称:标签
[root@VM-16-86-centos data]# docker commit -a "guan" -m "oracle19c"  a3ac36cf068a  oracle19c:19.3
sha256:3c052c4bfb27d95728f5212216f9e6d9fcdee29111d6ef61105f54d182b865fa

[root@VM-16-86-centos data]# docker images
REPOSITORY                   TAG         IMAGE ID       CREATED              SIZE
oracle19c                    19.3        3c052c4bfb27   About a minute ago   11.1GB
oracle/database              19.3.0-ee   82192fd0a0b1   2 hours ago          6.53GB
oraclelinux                  7-slim      0a28ba78f4c9   8 weeks ago          132MB
wnameless/oracle-xe-11g-r2   latest      0d19fd2e072e   22 months ago        2.1GB
 
拖到本地
[root@VM-16-86-centos data]# docker save -o oracle19c.tar oracle19c
[root@VM-16-86-centos data]# ll
total 11412344
drwxr-xr-x  3 root   root            4096 Nov 30  2014 expc
drwxr-xr-x 11 root   root            4096 Jun  3 17:27 mysql-8.0.18-el7-x86_64
drwxrwxr-x  4 oracle oinstall        4096 Aug 14 15:49 oracle
-rw-------  1 root   root     11090573824 Aug 14 15:54 oracle19c.tar
drwxr-xr-x  3 root   root            4096 Jul 14 15:27 pkg
drwxr-xr-x  8 root   root            4096 Jul 16 15:09 sysbench-0.5
-rw-r--r--  1 root   root          379910 Oct 15  2019 sysbench-0.5.zip
-rw-r--r--  1 root   root       595253657 May 22 23:51 v10.5_linuxx64_expc.tar.g

如果别的地方需要用这个镜相包有点大11.1GB,一般都是保存数据库初始化前的镜像
[root@VM-16-86-centos data]# docker save -o oracle19c_init.tar 82192fd0a0b1


#####################
将 oracle19c_init.tar 上传到其他服务器初始化数据库
 [root@VM-16-86-centos data]# scp oracle19c.tar 42.193.124.94:/data
 docker load -i  oracle11g.tar

其他服务器本地rpm安装docker  18版本
[root@VM-16-84-centos data]# cd /docker
[root@VM-16-84-centos docker]# ll
total 82028
-rw-r--r-- 1 root root  1369600 Jun  2  2020 busybox.tar
-rw-r--r-- 1 root root    34620 Jun  2  2020 container-selinux-2.55-1.el7.noarch.rpm
-rw-r--r-- 1 root root 36254876 Jun  2  2020 docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm
-rw-r--r-- 1 root root   165680 Jun  2  2020 libselinux-2.5-12.el7.x86_64.rpm
-rw-r--r-- 1 root root   240876 Jun  2  2020 libselinux-python-2.5-12.el7.x86_64.rpm
-rw-r--r-- 1 root root   154984 Jun  2  2020 libselinux-utils-2.5-12.el7.x86_64.rpm
-rw-r--r-- 1 root root   153596 Jun  2  2020 libsemanage-2.5-11.el7.x86_64.rpm
-rw-r--r-- 1 root root   114804 Jun  2  2020 libsemanage-python-2.5-11.el7.x86_64.rpm
-rw-r--r-- 1 root root   303736 Jun  2  2020 libsepol-2.5-8.1.el7.x86_64.rpm
-rw-r--r-- 1 root root    69596 Jun  2  2020 pigz-2.3.3-1.el7.centos.x86_64.rpm
-rw-r--r-- 1 root root   887548 Jun  2  2020 policycoreutils-2.5-22.el7.x86_64.rpm
-rw-r--r-- 1 root root   464972 Jun  2  2020 policycoreutils-python-2.5-22.el7.x86_64.rpm
-rw-r--r-- 1 root root 35773952 Jun  2  2020 registry.tar
-rw-r--r-- 1 root root   463504 Jun  2  2020 selinux-policy-3.13.1-192.el7_5.3.noarch.rpm
-rw-r--r-- 1 root root  6879848 Jun  2  2020 selinux-policy-targeted-3.13.1-192.el7_5.3.noarch.rpm
-rw-r--r-- 1 root root   634220 Jun  2  2020 setools-libs-3.3.8-2.el7.x86_64.rpm

[root@VM-3-11-centos docker]#  yum localinstall *.rpm  
或者
[root@VM-3-11-centos docker]# rpm -Uvh *.rpm --nodeps --force
[root@VM-3-11-centos docker]# yum install libltdl*
[root@VM-16-84-centos docker]# docker -v
Docker version 18.03.1-ce, build 9ee9f40
[root@VM-16-84-centos docker]# cd /data
[root@VM-16-84-centos data]# ll
total 6407960
-rw------- 1 root root 6561743872 Aug 14 16:50 oracle19c_init.tar

启动docker然后加载镜像
[root@VM-16-84-centos data]# systemctl start docker
[root@VM-16-84-centos data]#  docker load -i  oracle19c_init.tar
docker images

59759852752f: Loading layer [==================================================>]  138.3MB/138.3MB
9550e87abf8e: Loading layer [==================================================>]  6.144kB/6.144kB
df9bdaa744c5: Loading layer [==================================================>]  36.86kB/36.86kB
77637225ce51: Loading layer [==================================================>]  193.6MB/193.6MB
60836f228c7e: Loading layer [==================================================>]  6.208GB/6.208GB
e6a2db469328: Loading layer [==================================================>]  21.86MB/21.86MB
Loaded image ID: sha256:82192fd0a0b1575b2a2adb93829cfb7e48baea5e7c0f9e23de1e09811d00535a


REPOSITORY 和TAG均为none
[root@VM-16-84-centos data]# docker images
REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
<none>                       <none>              82192fd0a0b1        3 hours ago         6.53GB
wnameless/oracle-xe-11g-r2   latest              0d19fd2e072e        22 months ago       2.1GB

给镜像重命名
docker tag IMAGEID(镜像id) REPOSITORY:TAG(仓库:标签)
[root@VM-16-84-centos data]# docker tag  82192fd0a0b1 oracle19c:19.3-ee
[root@VM-16-84-centos data]# docker images
REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
oracle19c                    19.3-ee             82192fd0a0b1        3 hours ago         6.53GB
wnameless/oracle-xe-11g-r2   latest              0d19fd2e072e        22 months ago       2.1GB


最简运行
 docker run --name oracle-19c-test -p 1521:1521 -p 5500:5500 -e ORACLE_SID=ora19c -e ORACLE_PDB=test -e ORACLE_PWD=oracle   oracle19c:19.3-ee