简体   繁体   中英

How to store configuration and database outside orientdb docker container

I'm stuck trying to store OrientDB database and configuration outside of the docker container I'm running. This is the first time using both docker and orientdb so my confusion is multilevel.

Based on https://hub.docker.com/_/orientdb/ I have successfully ran the command docker run -d --name orientdb -p 2424:2424 -p 2480:2480 -e ORIENTDB_ROOT_PASSWORD=rootpwd orientdb but I'm stuck trying to specify where on my local disk to store data and configuration so its not lost when the container is stopped/removed.

I tried adding the -v <databases_path>:/orientdb/databases option but to no avail. I'm probably missing something very basic (since this is my first hands on experience with docker and orientdb). Trying to set up volumes in docker desktop and other trial and error tests have also failed.

Can anyone help? Or point me to some tutorial where I can learn because I'm stuck.

Thanks to @nulldroid I finally figured it out. It was the syntax which messed me up as usual. The following command worked for me. No need to set up volumes etc just a correct formatted path to the directory I already had created using the "/d/" in the beginning for windows "D:"

docker run -d --name orientdb -p 2424:2424 -p 2480:2480 -v /d/docker/test1/databases:/orientdb/databases -e ORIENTDB_ROOT_PASSWORD=root orientdb:latest

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM