Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Help get Oracle Docker Container to persist data in volume on Windows 10

User_03LQ0Jul 7 2021

Hi folks, I'm looking to use Oracle DB to do some basic app dev and testing on my Windows 10 laptop. I've got Oracle installed and running following the instructions here:
https://hub.docker.com/ Oracle Database Server Docker Image Documentation
My problem is that I can't seem to get the volume to work correctly. When I stop/start my container the database is destroyed. I know I need to set up a volume and use that volume when doing "docker run".
I have tried various verions of the docker run syntax and can't figure it out.
docker run -d -it -p 1521:1521 --name oracle -v C:\SAM\Docker\oracledockervolume\:/opt/oracle/oradata store/oracle/database-enterprise:12.2.0.1
Then I tried using "docker volume " to create a volume and then reference the created volume instead of something like "c:\..."
docker run -d -it -p 1521:1521 --name oracle -v sam_oracle:/opt/oracle/oradata store/oracle/database-enterprise:12.2.0.1
docker run -d -it -p 1521:1521 --name oracle -v sam_oracle:/ORCL store/oracle/database-enterprise:12.2.0.1
After running the container, connecting, creating my test table and data, when I do docker stop, docker start, my table is gone.
Does anyone know what I am doing wrong?
Thanks!

Comments
Post Details
Added on Jul 7 2021
0 comments
1,198 views