1、查找oracle镜像

[root@localhost ~]# docker search oracle
NAME                                  DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
oraclelinux                           Official Docker builds of Oracle Linux.         631                 [OK]
jaspeen/oracle-11g                    Docker image for Oracle 11g database            148                                     [OK]
oracleinanutshell/oracle-xe-11g                                                       83
oracle/openjdk                        Docker images containing OpenJDK Oracle Linux   60                                      [OK]
oracle/graalvm-ce                     GraalVM Community Edition Official Image        57                                      [OK]
absolutapps/oracle-12c-ee             Oracle 12c EE image with web management cons…   38
araczkowski/oracle-apex-ords          Oracle Express Edition 11g Release 2 on Ubun…   27                                      [OK]
bofm/oracle12c                        Docker image for Oracle Database                23                                      [OK]
oracle/nosql                          Oracle NoSQL on a Docker Image with Oracle L…   23                                      [OK]
datagrip/oracle                       Oracle 11.2 & 12.1.0.2-se2 & 11.2.0.2-xe        14                                      [OK]
oracle/weblogic-kubernetes-operator   Docker images containing the Oracle WebLogic…   10
truevoly/oracle-12c                   Copy of sath89/oracle-12c image (https://git…   9
openweb/oracle-tomcat                 A fork off of Official tomcat image with Ora…   8                                       [OK]
18fgsa/oracle-client                  Hosted version of the Oracle Container Image…   2
softwareplant/oracle                  oracle db                                       2                                       [OK]
iamseth/oracledb_exporter             A Prometheus exporter for Oracle modeled aft…   2
paulosalgado/oracle-java8-ubuntu-16   Oracle Java 8 on Ubuntu 16.04 LTS.              2                                       [OK]
roboxes/oracle7                       A generic Oracle Linux 7 base image.            1
publicisworldwide/oracle-core         This is the core image based on Oracle Linux…   1                                       [OK]
bitnami/oraclelinux-extras            Oracle Linux base images                        0                                       [OK]
pivotaldata/oracle7-test              Oracle Enterprise Linux (OEL) image for GPDB…   0
toolsmiths/oracle7-test                                                               0
bitnami/oraclelinux-runtimes          Oracle Linux runtime-optimized images           0                                       [OK]
arm64v8/oraclelinux                   Official Docker builds of Oracle Linux.         0
amd64/oraclelinux                     Official Docker builds of Oracle Linux.         0

2、拉取镜像

docker pull absolutapps/oracle-12c-ee

3、启动镜像

[root@localhost ~]# docker run -d --name oracle1 -p 8080:8080 -p 1521:1521 absolutapps/oracle-12c-ee
c8e8eae9f2690a9445575211eb23280e2f85559258774b3f28585cc977feebc0

4、进入镜像系统

 docker exec -it c8e8eae9f2690a9445575211eb23280e2f85559258774b3f28585cc977feebc0  /bin/bash
[root@c8e8eae9f269 /]#

5、连接数据库

[root@c8e8eae9f269 /]# sqlplus system/oracle@//localhost:1521/orcl

SQL*Plus: Release 12.1.0.2.0 Production on Tue Feb 18 01:48:32 2020

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL>

6、清理属于终止状态的容器

列出容器

[root@localhost ~]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
75dc4c479379 absolutapps/oracle-12c-ee "/entrypoint.sh" 10 hours ago Exited (1) 10 hours ago oracle1
50a35309e1c9 absolutapps/oracle-12c-ee "/entrypoint.sh" 11 hours ago Exited (137) 10 hours ago oracle

删除容器

docker container rm +CONTAINER ID

7、SQL Developer新建连接

docker安装oracle 12c