1. 下载oracle-12.2.0.1的安装包并上传到服务器上。
  2. github下载文件并上传到服务器上
    注意:安装文件包要放到dockerfile/12.2.0.1目录中
  3. build oracle-docker镜像
./buildDockerImage.sh -v 12.2.0.1 -e -i

Usage: buildDockerImage.sh -v [version] [-e | -s | -x] [-i] [-o] [Docker build option]
Builds a Docker Image for Oracle Database.

Parameters:
   -v: version to build
       Choose one of: 11.2.0.2  12.1.0.2  12.2.0.1
   -e: creates image based on 'Enterprise Edition'
   -s: creates image based on 'Standard Edition 2'
   -x: creates image based on 'Express Edition'
   -i: ignores the MD5 checksums
   -o: passes on Docker build option

* select one edition only: -e, -s, or -x
  1. 运行镜像
    应该先设置一下主机上用来存放数据的目录权限:
    chmod 777 -R /vdb1/db/docker-oracle-data/
    要不然启动容器时创建数据库会提示权限不足。
docker run --name oracle12c \
-p 1521:1521 -p 5500:5500 \
-v  /vdb1/db/docker-oracle-data:/opt/oracle/oradata \
oracle/database:12.2.0.1-ee

原来oracle12c里新出一个CDB和PDB的概念,允许一个数据库容器(CDB)承载多个可插拔数据库(PDB)。
docker exec oracle/database:12.2.0.1-ee ./setPassword.sh <your password>

docker run --name <container name> \
-p 1521:1521 -p 5500:5500 \
-e ORACLE_CHARACTERSET=<your character set> \
-v [<host mount point>:]/opt/oracle/oradata \
oracle/database:12.2.0.1-ee

Parameters:
   --name:        The name of the container (default: auto generated)
   -p:            The port mapping of the host port to the container port. 
                  Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express)
   -e ORACLE_SID: The Oracle Database SID that should be used (default: ORCLCDB)
   -e ORACLE_PDB: The Oracle Database PDB name that should be used (default: ORCLPDB1)
   -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated)
   -e ORACLE_CHARACTERSET:
                  The character set to use when creating the database (default: AL32UTF8)
   -v /opt/oracle/oradata
                  The data volume to use for the database.
                  Has to be writable by the Unix "oracle" (uid: 54321) user inside the container!
                  If omitted the database will not be persisted over container recreation.
   -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup
                  Optional: A volume with custom scripts to be run after database startup.
                  For further details see the "Running scripts after setup and on startup" section below.
   -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup
                  Optional: A volume with custom scripts to be run after database setup.
                  For further details see the "Running scripts after setup and on startup" section below.

 

作者:潘祖龙
链接:https://www.jianshu.com/p/3dcc43640c3a
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

记一次向maven中央仓库提交依赖包

阅读目录 提交工单Maven相关配置配置gpg-key部署发布参考资料 Maven是Java中最常用的依赖管理工具,Maven的中央仓库保罗万象,涵盖了各个领域的框架、...

阅读全文

MAC算法通过CBC来实现ECB

先来交代下背景吧,什么是MAC就不解释了,网上搜搜一大堆。简单来说这次MAC要上送的他方MAC的算法是ECB模式(POS终端直接模式),但在我们使用的加密机中计算M...

阅读全文

Spring Boot : 使用 Zuul 实现 API Gateway 的路由和过滤 ( Routing and Filtering )

Spring Boot : 使用 Zuul 实现 API Gateway 的路由和过滤 ( Routing and Filtering ) image.png 本节通过使用 Netflix Zuul 实现微服应用中的...

阅读全文

欢迎留言