root@- rac1:/home/# docker pull sath89/oracle-12c
使用刚刚下载下来的12g image创建一个container,并运行其上的oracle
[root@-rac1 ~]# docker run -d -p 8080:8080 -p 1521:1521 -v /my/oracle/data:/u01/app/oracle sath89/oracle-12c[root@-rac1 ~]# docker logs -f ffbeb07058449672c640ddb4e59b8376dae2e3b4dd54142871da7adbc069ee79
可以看到创建的container已经在运行中
[root@-rac1 ~]~$ docker ps
container id image command created status ports names
9e893d773494 sath89/oracle-12c “/entrypoint.sh ” 15 minutes ago up 15 minutes 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp clever_chandrasekhar
进入oracle container
[root@-rac1 ~]~$ docker exec -it 9e893d773494 /bin/bash
root@9e893d773494:/# su oracle
oracle@9e893d773494:~$ $oracle_home/bin/sqlplus / as sysdba
sql*plus: release 12.1.0.2.0 production on fri feb 24 03:03:00 2017
copyright (c) 1982, 2014, oracle. all rights reserved.
sql>
oracle 使用的实例名,用户名,密码如下
———————————————
hostname: localhost
port: 1521
sid: xe
username: system
password: oracle