很簡單:泊塢窗Neo4j的容器,只是掛
[email protected]:~/development$ docker -v
Docker version 1.6.2, build 7c8fca2
我跑these instructions開始泊塢窗。
docker run --detach --name neo4j --publish 7474:7474 \
--volume $HOME/neo4j/data:/data neo4j
這裏沒有什麼令人興奮的;這應該都是正常的。 但是,http://localhost:7474不響應。當我跳進容器時,它似乎響應得很好(參見調試會話)。我錯過了什麼?
[email protected]:~$ 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
[email protected]:~$ curl http://localhost:7474
^C
[email protected]:~$ time curl http://localhost:7474
^C
real 0m33.353s
user 0m0.008s
sys 0m0.000s
[email protected]:~$ docker exec -it 2d9e0d5d2f7389ed8b7c91d923af4a664471a93f805deb491b20fe14d389a3d2 /bin/bash
[email protected]:/var/lib/neo4j# curl http://localhost:7474
{
"management" : "http://localhost:7474/db/manage/",
"data" : "http://localhost:7474/db/data/"
}[email protected]:/var/lib/neo4j# exit
[email protected]:~$ 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/
你在容器裏面試過'netstat'嗎?似乎只有服務器綁定到本地主機。 – loadaverage
這看起來像我一樣的問題:http://stackoverflow.com/questions/35850160/cant-connect-to-a-docker-container-port-where-an-app-is-listening –
什麼docker --version報告? –