The docker image contains a unconfigured orientdb installation and for running it you need to provide your own config folder from which OrientDB will read its startup settings. To get an initial set of configurations from this setup, you can do something like the following:
# Run the container stock with no volumes mounted docker run --name orientdb -d broadinstitute/orientdb:latest # Go to the path that will eventually hold your configs cd $CONFIG_PATH # Copy the config directory from the stock container docker cp orientdb:/opt/orientdb/config . # Move all the files from that local "config" directory up a level mv config/* . # Remove the temporary "config" directory rmdir config
The directory at $CONFIG_PATH should now have a copy of the stock config files that you can now edit to suit your own needs. To start OrientDB using volume mounts to keep your data safe outside the container, run:
docker run --name orientdb -d \ -v $CONFIG_PATH:/opt/orientdb/config \ -v $DATABASES_PATH:/opt/orientdb/databases \ -v $BACKUP_PATH:/opt/orientdb/backup \ -p 2424 -p 2480 broadinstitute/orientdb:latest
The same applies for the databases folder which if local to the running container would go away as soon as it died/you killed it.
The backup folder only needs to be mapped if you activate that setting on your OrientDB configuration file.
For more Docker information from the makers of OrientDB, check out https://github.com/orientechnologies/orientdb-docker/wiki.
Included in this repository is also a
docker-compose.yml file for use with Docker Compose that will make running the container much easier.
Running the orientdb console
docker run --rm -it \ -v $CONFIG_PATH:/opt/orientdb/config \ -v $DATABASES_PATH:/opt/orientdb/databases \ -v $BACKUP_PATH:/opt/orientdb/backup \ broadinstitute/orientdb:latest \ /opt/orientdb/bin/console.sh
or, if you already have OrientDB running with the correct volume mounts, etc. (assumed to be named orientdb in this example) and just want to run the console from the running container:
docker exec -it \ orientdb \ /opt/orientdb/bin/console.sh