{"id":18257827,"url":"https://github.com/janusgraph/janusgraph-docker","last_synced_at":"2025-04-04T18:31:20.561Z","repository":{"id":37789647,"uuid":"146313205","full_name":"JanusGraph/janusgraph-docker","owner":"JanusGraph","description":"JanusGraph Docker images","archived":true,"fork":false,"pushed_at":"2023-10-09T06:27:16.000Z","size":129,"stargazers_count":97,"open_issues_count":15,"forks_count":85,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-02-28T17:45:21.866Z","etag":null,"topics":["docker","janusgraph"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JanusGraph.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-27T14:59:05.000Z","updated_at":"2024-10-25T08:17:17.000Z","dependencies_parsed_at":"2024-11-05T10:56:22.761Z","dependency_job_id":null,"html_url":"https://github.com/JanusGraph/janusgraph-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanusGraph%2Fjanusgraph-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanusGraph%2Fjanusgraph-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanusGraph%2Fjanusgraph-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JanusGraph%2Fjanusgraph-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JanusGraph","download_url":"https://codeload.github.com/JanusGraph/janusgraph-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247229330,"owners_count":20905026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","janusgraph"],"created_at":"2024-11-05T10:27:51.053Z","updated_at":"2025-04-04T18:31:18.331Z","avatar_url":"https://github.com/JanusGraph.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Warning:** The Docker images are in the process to move back into main repo. Please open new issues and PRs in [the main repo](https://github.com/JanusGraph/janusgraph).\n\n# JanusGraph Docker images\n\n[![GitHub Workflow Status][actions-badge]][actions-url]\n[![Docker pulls][docker-pulls-img]][docker-hub-url]\n\nThis repository contains build scripts and configuration files for the official\n[JanusGraph][JG] Docker images, which are published on the [Docker Hub][docker-hub-url].\n\n\u003e **Note:** even though the examples below and in the Docker Compose config\n\u003e files (`*.yml`) use the `latest` image, when running a service in production,\n\u003e be sure to specify a specific numeric version to\n\u003e [avoid](https://medium.com/@mccode/the-misunderstood-docker-tag-latest-af3babfd6375)\n\u003e [unexpected](https://github.com/hadolint/hadolint/wiki/DL3007)\n\u003e [behavior changes](https://vsupalov.com/docker-latest-tag/)\n\u003e due to `latest` pointing to a new release version, see our [Docker tagging Policy](#docker-tagging-policy).\n\n## Usage\n\n### Start a JanusGraph Server instance\n\nThe default configuration uses the [Oracle Berkeley DB Java Edition][JG_BDB] storage backend\nand the [Apache Lucene][JG_LUCENE] indexing backend:\n\n```bash\ndocker run --rm --name janusgraph-default docker.io/janusgraph/janusgraph:latest\n```\n\n### Connecting with Gremlin Console\n\nStart a JanusGraph container and connect to the `janusgraph` server remotely\nusing Gremlin Console:\n\n```bash\n$ docker run --rm --link janusgraph-default:janusgraph -e GREMLIN_REMOTE_HOSTS=janusgraph \\\n    -it docker.io/janusgraph/janusgraph:latest ./bin/gremlin.sh\n\n         \\,,,/\n         (o o)\n-----oOOo-(3)-oOOo-----\nplugin activated: janusgraph.imports\nplugin activated: tinkerpop.server\nplugin activated: tinkerpop.utilities\nplugin activated: tinkerpop.hadoop\nplugin activated: tinkerpop.spark\nplugin activated: tinkerpop.tinkergraph\ngremlin\u003e :remote connect tinkerpop.server conf/remote.yaml\n==\u003eConfigured janusgraph/172.17.0.2:8182\ngremlin\u003e :\u003e g.addV('person').property('name', 'chris')\n==\u003ev[4160]\ngremlin\u003e :\u003e g.V().values('name')\n==\u003echris\n```\n\n### Using Docker Compose\n\nStart a JanusGraph Server instance using [`docker-compose.yml`](docker-compose.yml):\n\n```bash\ndocker-compose -f docker-compose.yml up\n```\n\nStart a JanusGraph container running Gremlin Console in the same network using\n[`docker-compose.yml`](docker-compose.yml):\n\n```bash\ndocker-compose -f docker-compose.yml run --rm \\\n    -e GREMLIN_REMOTE_HOSTS=janusgraph janusgraph ./bin/gremlin.sh\n```\n\n### Initialization\n\nWhen the container is started it will execute files with the extension\n`.groovy` that are found in `/docker-entrypoint-initdb.d` with the\nGremlin Console.\nThese scripts are only executed after the JanusGraph Server instance was\nstarted.\nSo, they can [connect to it][JG_CONNECT_JAVA] and execute Gremlin traversals.\n\nFor example, to add a vertex to the graph, create a file\n`/docker-entrypoint-initdb.d/add-vertex.groovy` with the following content:\n\n```groovy\ng = traversal().withRemote('conf/remote-graph.properties')\ng.addV('demigod').property('name', 'hercules').iterate()\n```\n\n### Generate Config\n\nJanusGraph-Docker has a single utility method. This method writes the JanusGraph Configuration and show the config afterward.\n\n```bash\ndocker run --rm -it docker.io/janusgraph/janusgraph:latest janusgraph show-config\n```\n\n**Default config locations are `/etc/opt/janusgraph/janusgraph.properties` and `/etc/opt/janusgraph/janusgraph-server.yaml`.**\n\n## Configuration\n\nThe JanusGraph image provides multiple methods for configuration, including using environment\nvariables to set options and using bind-mounted configuration.\n\n### Docker environment variables\n\nThe environment variables supported by the JanusGraph image are summarized below.\n\n| Variable | Description | Default |\n| ---- | ---- | ---- |\n| `JANUS_PROPS_TEMPLATE` | JanusGraph properties file template (see [below](#properties-template)). |`berkeleyje-lucene` |\n| `janusgraph.*` | Any JanusGraph configuration option to override in the template properties file, specified with an outer `janusgraph` namespace (e.g., `janusgraph.storage.hostname`). See [JanusGraph Configuration][JG_CONFIG] for available options. | no default value | \n| `gremlinserver.*` | Any Gremlin Server configuration option to override in the default configuration (YAML) file, specified with an outer `gremlinserver` namespace (e.g., `gremlinserver.threadPoolWorker`). You can set or update nested options using additional dots (e.g., `gremlinserver.graphs.graph`). See [Gremlin Server Configuration][GS_CONFIG] for available options. See [Gremlin Server Environment Variable Syntax](#Gremlin-Server-Environment-Variable-Syntax) section below for help editing gremlin server configuration using environment variables. | no default value` | \n| `JANUS_SERVER_TIMEOUT` | Timeout (seconds) used when waiting for Gremlin Server before executing initialization scripts. | `30` |\n| `JANUS_STORAGE_TIMEOUT` | Timeout (seconds) used when waiting for the storage backend before starting Gremlin Server. | `60` |\n| `GREMLIN_REMOTE_HOSTS` | Optional hostname for external Gremlin Server instance. Enables a container running Gremlin Console to connect to a remote server using `conf/remote.yaml` (or `remote-objects.yaml`). | no default value | \n| `JANUS_INITDB_DIR` | Defines the location of the initialization scripts.  | `/docker-entrypoint-initdb.d` |\n\n#### Properties template\n\nThe `JANUS_PROPS_TEMPLATE` environment variable is used to define the base JanusGraph\nproperties file. Values in the template properties file are used unless an alternate value\nfor a given property is provided in the environment. The common usage will be to specify\na template for the general environment (e.g., `cassandra-es`) and then provide additional\nindividual configuration to override/extend the template. The available templates depend\non the JanusGraph version (see [`conf/janusgraph*.properties`][JG_TEMPLATES]).\n\n| `JANUS_PROPS_TEMPLATE` | Supported Versions |\n| ----- | ----- |\n| `berkeleyje` | all |\n| `berkeleyje-es` | all |\n| `berkeleyje-lucene` (default) | all |\n| `cassandra-es` | \u003c=0.5.3 |\n| `cql-es` | \u003e=0.2.1 |\n| `cql` | \u003e=0.5.3 |\n| `inmemory` | \u003e=0.5.3 |\n\n##### Example: Berkeleyje-Lucene\n\nStart a JanusGraph instance using the default `berkeleyje-lucene` template with custom\nstorage and server settings:\n\n```bash\ndocker run --name janusgraph-default \\\n    -e janusgraph.storage.berkeleyje.cache-percentage=80 \\\n    -e gremlinserver.threadPoolWorker=2 \\\n    docker.io/janusgraph/janusgraph:latest\n```\n\nInspect the configuration:\n\n```bash\n$ docker exec janusgraph-default sh -c 'cat /etc/opt/janusgraph/janusgraph.properties | grep ^[a-z]'\ngremlin.graph=org.janusgraph.core.JanusGraphFactory\nstorage.backend=berkeleyje\nstorage.directory=/var/lib/janusgraph/data\nindex.search.backend=lucene\nstorage.berkeleyje.cache-percentage=80\nindex.search.directory=/var/lib/janusgraph/index\n\n$ docker exec janusgraph-default grep threadPoolWorker /etc/opt/janusgraph/janusgraph-server.yaml\nthreadPoolWorker: 2\n```\n\n##### Example: Cassandra-ES with Docker Compose\n\nStart a JanusGraph instance with Cassandra and Elasticsearch using the `cql-es`\ntemplate through [`docker-compose-cql-es.yml`](docker-compose-cql-es.yml):\n\n```bash\ndocker-compose -f docker-compose-cql-es.yml up\n```\n\nInspect the configuration using\n[`docker-compose-cql-es.yml`](docker-compose-cql-es.yml):\n\n```bash\n$ docker-compose -f docker-compose-cql-es.yml exec \\\n      janusgraph sh -c 'cat /etc/opt/janusgraph/janusgraph.properties | grep ^[a-z]'\ngremlin.graph=org.janusgraph.core.JanusGraphFactory\nstorage.backend=cql\nstorage.hostname=jce-cassandra\ncache.db-cache = true\ncache.db-cache-clean-wait = 20\ncache.db-cache-time = 180000\ncache.db-cache-size = 0.25\nindex.search.backend=elasticsearch\nindex.search.hostname=jce-elastic\nindex.search.elasticsearch.client-only=true\nstorage.directory=/var/lib/janusgraph/data\nindex.search.directory=/var/lib/janusgraph/index\n```\n\n#### Gremlin Server Environment Variable Syntax\n\nEnvironment Variables that start with the prefix `gremlinserver.` or `gremlinserver%d.` are used\nto edit the base janusgraph-server.yaml file. The text after the prefix in the environment variable\nname should follow a specific syntax. This syntax is implemented using the [yq][YQ_GITHUB] write and\ndelete commands and the [yq documentation][YQ_DOC] can be used as a reference for this syntax.\nSecondly, the value of the environment variable will be used to set the value of the key specified\nin the environment variable name.\n\nLet's take a look at a few examples:\n\n##### Nested Properties\n\nFor example, say we want to add a configuration property `graphs.ConfigurationMangementGraph`\nwith the value `conf/JanusGraph-configurationmanagement.properties`:\n\n```text\n$ docker run --rm -it -e gremlinserver.graphs.ConfigurationManagementGraph=\\\nconf/JanusGraph-configurationmanagement.properties docker.io/janusgraph/janusgraph:latest janusgraph show-config\n...\ngraphs:\n  graph: conf/janusgraph-cql-es-server.properties\n  ConfigurationManagementGraph: conf/JanusGraph-configurationmanagement.properties\nscriptEngines:\n...\n```\n\n##### Delete a component\n\nTo delete a component append %d to the 'gremlinserver.' prefix before the closing dot and then\nselect the component following the prefix. Don't forget the trailing '='. For example to delete the\ngraphs.graph configuration property we can do the following:\n\n```text\n$ docker run --rm -it -e gremlinserver%d.graphs.graph= docker.io/janusgraph/janusgraph:latest janusgraph show-config\n...\nchannelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer\ngraphs: {}\nscriptEngines:\n...\n```\n\n##### Append item and alternate indexing syntax\n\nThis example shows how to append an item to a list. This can be done by adding \"[+]\" at the end of\nthe environment variable name. This example also shows how to use square bracket syntax as an\nalternative to the dot syntax. This alternate syntax is useful if one of the keys in the property\npath contains special characters as we see in the example below.\n\n```text\n$ docker run --rm -it -e gremlinserver.scriptEngines.gremlin-groovy\\\n.plugins[\"org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin\"]\\\n.files[+]=/scripts/another-script.groovy docker.io/janusgraph/janusgraph:latest janusgraph show-config\n...\nscriptEngines:\n  gremlin-groovy:\n    plugins:\n      org.janusgraph.graphdb.tinkerpop.plugin.JanusGraphGremlinPlugin: {}\n      org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}\n      org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}\n      org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin:\n        classImports:\n        - java.lang.Math\n        methodImports:\n        - java.lang.Math#*\n      org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin:\n        files:\n        - scripts/empty-sample.groovy\n        - /scripts/another-script.groovy\n...\n```\n\n### Mounted Configuration\n\nBy default, the container stores both the `janusgraph.properties` and `janusgraph-server.yaml` files\nin the `JANUS_CONFIG_DIR` directory which maps to `/etc/opt/janusgraph`. When the container\nstarts, it updates those files using the environment variable values. If you have a specific\nconfiguration and do not wish to use environment variables to configure JanusGraph, you can\nmount a directory containing your own version of those configuration files into the container\nthrough a bind mount, e.g., `-v /local/path/on/host:/etc/opt/janusgraph:ro`. You'll need to bind\nthe files as read-only, however, if you do not wish to have the environment variables override the\nvalues in that file.\n\n#### Example with mounted configuration\n\nStart a JanusGraph instance with mounted configuration using\n[`docker-compose-mount.yml`](docker-compose-mount.yml):\n\n```bash\n$ docker-compose -f docker-compose-mount.yml up\njanusgraph-mount | chown: changing ownership of '/etc/opt/janusgraph/janusgraph.properties': Read-only file system\n...\n```\n\n## Default user JanusGraph\n\n\u003e **Note:** The default user of the image changed for all version beginning with the newest image version of 0.5.3.\n\nThe user is created with uid 999 and gid 999 and user's a home dir is `/var/lib/janusgraph`. \n\nFollowing folder are created with these user rights:\n* `/var/lib/janusgraph`\n* `/etc/opt/janusgraph`\n* `/opt/janusgraph`\n* `/docker-entrypoint-initdb.d`\n\n## Docker Tagging Policy\n\nHere's the policy we follow for tagging our Docker images:\n\n| Tag            | Support level | Docker base image      |\n|:--------------|:-------------|------------------------|\n| latest         | \u003cul\u003e\u003cli\u003elatest JanusGraph release\u003c/li\u003e\u003cli\u003eno breaking changes guarantees\u003c/li\u003e\u003c/ul\u003e | eclipse-temurin:11-jre |\n| x.x            | \u003cul\u003e\u003cli\u003enewest patch-level version of JanusGraph\u003c/li\u003e\u003cli\u003eexpect breaking changes\u003c/li\u003e\u003c/ul\u003e | eclipse-temurin:8-jre  |\n| x.x.x          | \u003cul\u003e\u003cli\u003edefined JanusGraph version\u003c/li\u003e\u003cli\u003ebreaking changes are only in this repo\u003c/li\u003e\u003c/ul\u003e | eclipse-temurin:8-jre  |\n| x.x.x-revision | \u003cul\u003e\u003cli\u003edefined JanusGraph version\u003c/li\u003e\u003cli\u003edefined commit in JanusGraph-docker repo\u003c/li\u003e\u003c/ul\u003e | eclipse-temurin:8-jre  |\n\nWe collect a list of changes in our docker images build process in our [CHANGELOG.md](./CHANGELOG.md)\n\n## Community\n\nJanusGraph-Docker uses the same communication channels as JanusGraph in general.\nPlease refer to the\n[_Community_ section in JanusGraph's main repository][JG_COMMUNITY]\nfor more information about these various channels.\n\nPlease use GitHub issues only to report bugs or request features.\n\n## Contributing\n\nPlease see\n[`CONTRIBUTING.md` in JanusGraph's main repository][JG_CONTRIBUTING]\nfor more information, including CLAs and best practices for working with\nGitHub.\n\n## License\n\nJanusGraph Docker images are provided under the [Apache 2.0\nlicense](APACHE-2.0.txt) and documentation is provided under the [CC-BY-4.0\nlicense](CC-BY-4.0.txt). For details about this dual-license structure, please\nsee [`LICENSE.txt`](LICENSE.txt).\n\n[actions-badge]: https://img.shields.io/github/actions/workflow/status/JanusGraph/janusgraph-docker/docker.yml?branch=master\n[actions-url]: https://github.com/JanusGraph/janusgraph-docker/actions\n[docker-pulls-img]: https://img.shields.io/docker/pulls/janusgraph/janusgraph.svg\n[docker-hub-url]: https://hub.docker.com/r/janusgraph/janusgraph\n[JG]: https://janusgraph.org/\n[JG_BDB]: https://docs.janusgraph.org/storage-backend/bdb/\n[JG_CONFIG]: https://docs.janusgraph.org/basics/configuration-reference/\n[JG_LUCENE]: https://docs.janusgraph.org/index-backend/lucene/\n[JG_CONNECT_JAVA]: https://docs.janusgraph.org/connecting/java/\n[JG_TEMPLATES]: https://github.com/search?q=org:JanusGraph+repo:janusgraph+filename:janusgraph.properties%20path:janusgraph-dist/src/assembly/static/conf/gremlin-server\n[GS_CONFIG]: http://tinkerpop.apache.org/docs/current/reference/#_configuring_2\n[YQ_GITHUB]: https://github.com/mikefarah/yq\n[YQ_DOC]: https://mikefarah.gitbook.io/yq\n[DH]: https://hub.docker.com/\n[JG_COMMUNITY]: https://github.com/JanusGraph/janusgraph#community\n[JG_CONTRIBUTING]: https://github.com/JanusGraph/janusgraph/blob/master/CONTRIBUTING.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanusgraph%2Fjanusgraph-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanusgraph%2Fjanusgraph-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanusgraph%2Fjanusgraph-docker/lists"}