Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

neo4j - How to find a particular folder in volume mounted using Docker?

I am using Neo4j using Docker image to up the database on Windows 10.

The command:

docker run --publish=7474:7474 --publish=7687:7687 --volume=$HOME/neo4j/data:/data neo4j

Now I want to delete some files in the folder named 'default.graphdb'.

I can enter the Docker container using command

docker exec -it <docker-container-id> /bin/bash

Please let me know where can I find the folder, and how to delete few files or the entire folder.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You're mounting a local directory $HOME/neo4j/data to the /data directory in the container. So, the content of the directory in the container will be synced with your local one.

There is actually no need to enter the container to view the content since if you delete something locally it will be reflected in the container as well.

But to reply fully, in the container it is exactly where you mapped when defining the volume, in /data :

$ docker exec -it neo4j_1 sh
# ls
LICENSE.txt  LICENSES.txt  NOTICE.txt  README.txt  UPGRADE.txt  bin  certificates  conf  data  import  lib  logs  metrics  plugins  run
# cd /data
# ls
databases  dbms  transactions
#

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...