oracle11g docke搭建

  1. 先不挂载宿主机目录,用以下命令启动,或者将docker-compose中的volumes注释掉。启动有点慢,耐心等待。
docker run -d -p 11521:1521 \
-e ORACLE_ALLOW_REMOTE=true \
-e ORACLE_DISABLE_ASYNCH_IO=true \
-e ORACLE_ENABLE_XDB=true \
--name oracle11g \
oracleinanutshell/oracle-xe-11g
  1. 启动成功后将镜像内的/u01/app/oracle/此目录的文件cp到宿主机中。
  2. 在通过docker-compose 挂载宿主机目录启动。
version: '3'
services:
 oracle11g:
   image: oracleinanutshell/oracle-xe-11g
   container_name: oracle11g
   privileged: true
   environment:
      - TZ=Asia/Shanghai
      - ORACLE_ALLOW_REMOTE=true
      - ORACLE_DISABLE_ASYNCH_IO=true
      - ORACLE_ENABLE_XDB=true
   volumes:
     - ./data/app/oracle/:/u01/app/oracle/
   ports:
     - 11521:1521
   restart: always

4.链接信息
sid: xe
username: system
password: oracle

docker仓库地址

posted @ 2022-06-21 16:38  xionghaizhi  阅读(125)  评论(0编辑  收藏  举报