-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker compose persistence #2904
Comments
The volume configuration you've defined creates an anonymous volume. Running To solve this, use a named volume bind-mount instead. I recommend this option, since it gives you control over the location of the database datafiles. Anonymous or unbound named volumes are saved under the protected
Then, reference the named volume in your compose specification:
If you prefer to use an unbound volume, the steps are:
The compose yaml file looks nearly identical; just exclude the
If you've run
And remove them using:
(Running HTH! |
Ok, the first time I run this new volume configuration all seems good. I see my init.d script running, and I end up with a new folder in my current directory which is the host folder where I have pointed a new volume to. The volume creation:
docker-compose config:
The local oradata folder is populated:
Hitting ctrl-c in docker-compose and re-run After running
So it persists between restarts but fails after down/up. |
There's one subtle thing missing from the volume creation command:
That creates a volume, but not a named volume. Try this:
Since you're seeing files populated in the local device directory when starting compose, I think there's something else going on.
I did a quick test to see the difference. First, I created an anonymous volume (without appending a name after the
Note that the output is a hash. Next, I ran the command and added a volume name:
Note the output returned the volume name. I inspect the first volume:
Then the second:
Note the differences (unnamed vs. named):
What I think is happening here is that the anonymous volume was bound to the same location as the named volume, which is completely legal:
Or, you could just drop any existing volumes, create a new, named volume, and try |
Ok, I made sure to use the named version of the volume command. This data is persisting technically, and I can see files in the folder after stopping and starting the docker-compose service but oracle is complaining on the second oracle │ #################################################################### |
Hmm. OK, let me take a look and see if I can duplicate this locally (hopefully over the weekend). Do you mind sharing your |
Sorry, also the output of |
Looks related to this: How/where do I set that path? |
I think this might be caused by my CREATE TABLESPACE DATA DATAFILE I am running in my initdb.d scripts. Trying to use the fill filepath for the datafile. |
When I try to use the docker compose examples I am only able to have persistence between container restarts. If I kill the containers using down I end up with errors such as this:
I am configuring the volume like this:
I found some discussions about using a DATAFILE option during the tablespace creation, and maybe that is an option that would work, but I was unable to find where that is happening.
The text was updated successfully, but these errors were encountered: