[Docker] - Install Oracle DB over Docker as development DB

Because database is just for development usage, I chose Oracle XE, and I found there is a nice image which lots of people have pull and benefited from, 

wnameless/oracle-xe-11g, over 100k people have used it.


Following the steps:

Pull Image from docker repository

> docker pull wnameless/oracle-xe-11g

# show all images in your docker
> docker images

Run image to create container

> docker run —name oracle11g -d -p 9090:8080 -p 2222:22 -p 1521:1521  wnameless/oracle-xe-11g

# name this container oracle11g, later on we can operate this container with this name 
# Container’s 8080 port (apex) is mapped to virtual box docker daemon’s 9090
# Container’s 22 port (ssh) is mapped to virtual box docker daemon’s 2222
# Container’s 1521 port (oracle db) is mapped to virtual box docker daemon’s 1521

# check current run containers, oracle11g should be right over here
> docker ps

The container, oralce11g, has been created. After this if you would like to start oracle db what you only need to do is to start the container.

Stop container

# stop container oracle11g
> docker stop oracle11g

> docker ps
# now oracle11g is not running, so it should not be displayed here.

# show all containers including not running ones, oracle11g should be here
> docker ps -a

Start container

# start container by container name
> docker start oracle11g

Find IP address of docker daemon (virtualbox docker vm)

docker-machine ls

It's 192.168.99.100 on my computer.

Basic info of container vm and oracle db

Oracle 11g XE
VM: 192.168.99.100
port: 1521
sid: xe
username: system and sys
password: oracle

oracle11g container VM
username: root
password: admin

You can su user oracle from root.

SSH connect to VM

ssh root@192.168.99.100 -p 2222

SQLDeveloper connect to DB


Enable oracle11g apex

> ssh root@192.168.99.100 -p 2222
> sqlplus sys/oracle as sysdba
SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK;
SQL> EXEC DBMS_XDB.SETHTTPPORT(8080);
SQL> COMMIT;
Open your browser access http://192.168.99.100:9090/apxe, then you might see









  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值