参考链接:https://www.cnblogs.com/microestc/p/docker-oscar.html
1.按照教程pull镜像
2.在run镜像时
!!!必要步骤修改
(1)在官网下载数据库的zip文件,将里面的license文件夹下的license.dat文件拷贝到某个位置
(2)修改运行指令
docker run -it -d -p 2003:2003 --name oscar -v /db-logs:/opt/ShenTong/log -v /dbs:/opt/ShenTong/odbs -v /license:/opt/ShenTong/license ccr.ccs.tencentyun.com/images.sz/oscar:v7.0.8
其中-v source:destion代表将本地的source文件夹和docker中的destion文件夹进行绑定
可以将source替换为你自己的路径(切忌不要将(1)中的license直接替换)
运行指令
此指令仅仅作为参考指令,可以自行修改,
但是对/opt/ShenTong/license的持久化是必要的!!!!
该容器会自动停止
并且在log中有
/*Session 65535*/ ERROR, 已超过试用版本的使用期限
(3)用(1)中保存的license.dat文件替换(2)中-v /license:/opt/ShenTong/license里你自己的/license路径中的license.dat文件
(4)再次启动容器
docker start oscar
可以正常使用
docker exec -it oscar bash
isql可以进入数据库
运行日志:
Starting oscaragent...
oscaragent startup success
If you want to exit the container, enter Ctrl+C, you will exit all container services.
instance recovery... 1: start log analyze RestartLSN: 6715904
instance recovery... 1: finish log analyze, waste 0(S)
instance recovery... 2: start prefetch dirty pages...
instance recovery... 2: prefetch dirty page count: 5
instance recovery... 2: finish prefetch dirty pages, waste 0(S)
instance recovery... 3: start redo, RedoStartLsn: 6715904
instance recovery... 3: finish redo, waste 0(S) RedoEndLsn: 6715904
/*Session 0*/ NOTICE, the system state: Open the multi user mode
instance recovery... 4: start undo...
instance recovery... 4: finish undo, waste 0(S)
Sent The Database Starting Message to Agent
/*Session 0*/ NOTICE, 安全通信, 与非安全版本客户端进行非安全通信...
/*Session 0*/ NOTICE, 会话连接断开