[Docker] - Install Oracle DB over Docker as development DB
2016-03-26 20:52
876 查看
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:
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.
It's 192.168.99.100 on my computer.
![](http://img.blog.csdn.net/20160326204709045?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
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
相关文章推荐
- 常用docker命令,及一些坑
- calico docker 应用实例
- Kubernetes安装部署
- 使用fluentd管理docker日志
- docker 实战---部署tomcat\weblogic集群 (二)
- 删除docker0网卡
- Docker相关笔记
- Docker隔绝上传文件
- docker迅速搭建可用 GitLab
- 用P2P方法快速分发Docker镜像
- docker 通过commit方法创建镜像(Tomcat+Java+Scala)
- 庆祝三周年:Docker 推出面向 Mac/Windows 平台的测试版
- Docker网络一览
- 深入理解Docker Volume(二)
- 深入理解Docker Volume(一)
- docker-compose 工具安装
- Docker:镜像的迁移
- 构建最小的docker容器
- 你要知道的Docker应用设计四大关键
- Docker基础技术:AUFS