Created
April 29, 2022 15:35
-
-
Save ppdouble/955ca8ea2391473e11c000ebd7b8c200 to your computer and use it in GitHub Desktop.
Neo4j in docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CUSTOMIZE_FOLDER=/home/software/neo4j/mygraphdb/ | |
docker run \ | |
--name mygraphdb \ | |
--publish=7474:7474 --publish=7687:7687 \ | |
--detach \ | |
--volume=$CUSTOMIZE_FOLDER/data:/data \ | |
--volume=$CUSTOMIZE_FOLDER/conf:/var/lib/neo4j/conf \ | |
--volume=$CUSTOMIZE_FOLDER/logs:/logs \ | |
--volume=$CUSTOMIZE_FOLDER/import:/import \ | |
--volume=$CUSTOMIZE_FOLDER/plugins:/plugins \ | |
--env NEO4J_AUTH=neo4j/MyGraphPass \ | |
--env NEO4J_dbms_memory_pagecache_size=1G \ | |
neo4j:latest |
Because the -v and --volume flags have been a part of Docker for a long time, their behavior cannot be changed. This means that there is one behavior that is different between -v and --mount.
If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host, -v creates the endpoint for you. It is always created as a directory.
If you use --mount to bind-mount a file or directory that does not yet exist on the Docker host, Docker does not automatically create it for you, but generates an error.
Example:
docker run --detach \
--interactive \
--name devtest \
--volumes="$(pwd)"/target:/app \
nginx:latest
docker run --detach \
--interactive \
--name devtest \
--mount type=bind,source="$(pwd)"/target,target=/app \
nginx:latest
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
docker exec --interactive --tty mygraphdb bash
Access the neo4j container