docker run --name myoracle1 \
-p 1512:1521 -p 5500:5500 \
-e ORACLE_PWD=Hao123.com \
-e ORACLE_CHARACTERSET=AL32UTF8 \
-v /opt/data/oracle:/opt/oracle/oradata \
registry.cn-hangzhou.aliyuncs.com/zhuyijun/oracle

 

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 (EM Express)
   -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://github.com/oracle/docker-images

https://github.com/oracle/docker-images/blob/main/OracleDatabase/SingleInstance/README.md

 

https://github.com/wnameless/docker-oracle-xe-11g

GitHub - oracle/docker-images: Official source for Docker configurations, images, and examples of Dockerfiles for Oracle products and projects

 

/my/oracle/data 目录需要设置权限
chown -R 1000:1000 /my/oracle/data

 执行命令启动容器

docker run -d --name myoracle  -p 8080:8080 -p 1521:1521 -v /my/oracle/data:/u01/app/oracle -e ORACLE_ALLOW_REMOTE=true -e ORACLE_CHARACTERSET=al32utf8 -e DBCA_TOTAL_MEMORY=2048 quay.io/maksymbilenko/oracle-12c
默认账号密码
http://localhost:8080/em
user: sys
password: oracle
connect as sysdba: true

 

posted on 2022-01-15 13:45  余昭(Ray)  阅读(122)  评论(0编辑  收藏  举报