- Learning Neo4j 3.x(Second Edition)
- Jér?me Baton Rik Van Bruggen
- 295字
- 2021-07-08 09:37:43
Running Neo4j in a Docker container
Now, run this long command in a Terminal to run Docker with a Neo4j image. Explanations are coming just after:
docker run --rm --publish=7474:7474 --publish=7687:7687 --volume=$HOME/neo4j/data:/data \
--volume=$HOME/neo4j/logs:/logs neo4j:3.1.2
This triggered some downloading because your local Docker repository does not have the Neo4j image available in its 3.1.2 version yet. Meanwhile, a useful magical incantation is to sing "run, baby, run"
Its form is: docker command parameters imageName:version.
In the parameters part, you can see--volume twice. Its use is to link the folder on your local filesystem to the container filesystem.
Then, providing the port numbers given as parameters were not in use, your Terminal should display something like this:

This informs you that Neo4j is expecting you to connect on port 7474 as usual. So fire your browser and browse to the very same URL we saw earlier, http://localhost:7474, and go graphing! (Your data will be persisted on disk.)
In order to stop Docker running your image, you need to pass not the name (of the image) but the identifier of the running container (based on the image).
So first, in another Terminal, type as follows:
docker ps
This will list all the containers running, in our case, only one. So we look at the first column, container_id, and use it as a parameter:
docker stop container_id


- Go語言高效編程:原理、可觀測性與優化
- Python自動化運維快速入門
- FFmpeg入門詳解:音視頻流媒體播放器原理及應用
- Instant 960 Grid System
- Node.js全程實例
- 零基礎入門學習Python(第2版)
- 一塊面包板玩轉Arduino編程
- C# Multithreaded and Parallel Programming
- Building Serverless Architectures
- Angular應用程序開發指南
- ActionScript 3.0從入門到精通(視頻實戰版)
- 深度學習程序設計實戰
- Docker:容器與容器云(第2版)
- Android高級開發實戰:UI、NDK與安全
- MATLAB 2020 GUI程序設計從入門到精通