原 【DB宝11】在Docker中只需2步即可拥有Oracle 11g企业版环境(11.2.0.3)
Tags: Oracle原创LinuxDocker安装部署小麦苗环境搭建快速体验体验
一、从Docker Hub或阿里云镜像下载小麦苗上传的镜像文件
- 小麦苗的Docker Hub的地址:https://hub.docker.com/u/lhrbest
- Oracle 11g DB的地址:https://hub.docker.com/repository/docker/lhrbest/oracle_11g_ee_lhr_11.2.0.3/tags?page=1
1 2 3 4 5 6 | # 从Docker hub下载,网络不好时,一般比较慢 docker pull lhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0 # 可以选择从阿里云下载 docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0 # 从阿里云下载后可以tag成如下形式 docker tag registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0 lhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0 |
镜像大概2.75G左右,解压后大约7G左右,所以请保留充足的空间。执行过程如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | [root@docker36 ~]# docker search 11.2.0.3 NAME DESCRIPTION STARS OFFICIAL AUTOMATED lhrbest/oracle_11g_ee_lhr_11.2.0.3 Oracle 11g 企业版, 11.2.0.3 ,QQ:646634621… 1 [root@docker36 ~]# [root@docker36 ~]# docker pull registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0 1.0: Pulling from lhrbest/oracle_11g_ee_lhr_11.2.0.3 5dd797628260: Pull complete 72716ec4f779: Pull complete Digest: sha256:95b663e35ab7a21581d6a0c2d15b18a98c1ac484cd2621778f744ef0e6d61394 Status: Downloaded newer image for registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0 registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0 [root@docker36 ~]# docker tag registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0 lhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0 [root@docker36 ~]# docker images | grep 11g lhrbest/oracle_11g_ee_lhr_11.2.0.3 1.0 ac837aaa3923 2 hours ago 7.07GB registry.cn-hangzhou.aliyuncs.com/lhrbest/oracle_11g_ee_lhr_11.2.0.3 1.0 ac837aaa3923 2 hours ago 7.07GB |
二、创建容器并启动数据库
1 2 3 4 5 6 7 8 9 10 11 12 | # 创建容器 docker run -itd --name lhrora11203 -h lhrora11203 --privileged=true -p 1521:1521 -p 222:22 -p 1158:1158 lhrbest/oracle_11g_ee_lhr_11.2.0.3:1.0 init # 进入容器 docker exec -it lhrora11203 bash # 启动数据库和监听 su - oracle lsnrctl start sqlplus / as sysdba startup |
执行过程:
不错哈