在Oracle数据库的docker卷中保存数据

我创build了用于存储我的应用程序数据库数据的docker volume create dbvolumedocker volume create dbvolume

然后,我启动了Oracle XE 11g数据库映像和数据卷的Docker容器。

docker run --name=OracleXE --shm-size=1g -p 1521:1521 -p 8080:8080 -e ORACLE_PWD=weblogic1 -v dbvolume:/opt/oracle/oradata oracle/database:11.2.0.2-xe

在数据库中存储了一些条目。 停止和删除容器,然后再次启动,但数据库中没有数据保存。

如何获得后续的应用程序请求的持久数据。

https://github.com/oracle/docker-images/tree/master/OracleDatabase

 -v /opt/oracle/oradata The data volume to use for the database. Has to be writable by the Unix "oracle" (uid: 54321) user inside the container! If omitted the database will not be persisted over container recreation.