Docker neo4j容器只是挂起

非常简单:

christian@christian:~/development$ docker -v Docker version 1.6.2, build 7c8fca2 

我运行这些指令来启动docker。

 docker run --detach --name neo4j --publish 7474:7474 \ --volume $HOME/neo4j/data:/data neo4j 

这里什么都没有 这应该都是正常的。 但是, http:// localhost:7474不响应。 当我跳进容器时,它似乎响应得很好(参见debugging会话)。 我错过了什么?

 christian@christian:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2d9e0d5d2f73 neo4j:latest "/docker-entrypoint. 15 minutes ago Up 15 minutes 7473/tcp, 0.0.0.0:7474->7474/tcp neo4j christian@christian:~$ curl http://localhost:7474 ^C christian@christian:~$ time curl http://localhost:7474 ^C real 0m33.353s user 0m0.008s sys 0m0.000s christian@christian:~$ docker exec -it 2d9e0d5d2f7389ed8b7c91d923af4a664471a93f805deb491b20fe14d389a3d2 /bin/bash root@2d9e0d5d2f73:/var/lib/neo4j# curl http://localhost:7474 { "management" : "http://localhost:7474/db/manage/", "data" : "http://localhost:7474/db/data/" }root@2d9e0d5d2f73:/var/lib/neo4j# exit christian@christian:~$ docker logs 2d9e0d5d2f7389ed8b7c91d923af4a664471a93f805deb491b20fe14d389a3d2 Starting Neo4j Server console-mode... /var/lib/neo4j/data/log was missing, recreating... 2016-03-07 17:37:22.878+0000 INFO No SSL certificate found, generating a self-signed certificate.. 2016-03-07 17:37:25.276+0000 INFO Successfully started database 2016-03-07 17:37:25.302+0000 INFO Starting HTTP on port 7474 (4 threads available) 2016-03-07 17:37:25.462+0000 INFO Enabling HTTPS on port 7473 2016-03-07 17:37:25.531+0000 INFO Mounting static content at /webadmin 2016-03-07 17:37:25.579+0000 INFO Mounting static content at /browser 2016-03-07 17:37:26.384+0000 INFO Remote interface ready and available at http://0.0.0.0:7474/ 

我无法重现这一点。 Docker 1.8.2。 &1.10.0与您的情况是一致的:

 docker run --detach --name neo4j --publish 7474:7474 neo4j curl -i 127.0.0.1:7474 HTTP/1.1 200 OK Date: Tue, 08 Mar 2016 16:45:46 GMT Content-Type: application/json; charset=UTF-8 Access-Control-Allow-Origin: * Content-Length: 100 Server: Jetty(9.2.4.v20141103) { "management" : "http://127.0.0.1:7474/db/manage/", "data" : "http://127.0.0.1:7474/db/data/" } 

尝试升级Docker并检查netfilter规则进行转发。

而不是请求localhost你会想使用docker-machine虚拟机IP地址,你可以用这个命令来确定:

 docker-machine inspect default | grep IPAddress 

要么

 curl -i http://$(docker-machine ip default):7474/ 

默认的IP地址是192.168.99.100

好的,基本上我把args中的卷装卸下来,然后运行。 最后,我不想要一个外面的容器装载。 感谢@LoadAverage提供的帮助。这仍然不是“正确的”,但对于我的目的我不在乎。

 christian@christian:~/development$ docker run --detach --name neo4j --publish 7474:7474 neo4j 6c94527816057f8ca1e325c8f9fa7b441b4a5d26682f72d42ad17614d9251170 christian@christian:~/development$ curl http://127.0.0.1:7474 { "management" : "http://127.0.0.1:7474/db/manage/", "data" : "http://127.0.0.1:7474/db/data/" } christian@christian:~/development$