CircleCI:configuration在gcp上托pipe的Docker容器的testing

我正在使用CircleCIbuild立一个持续部署stream程,以Google Container Engine为目标。 除了这个例子 ,我正在关注这个文档 。

我在这个阶段陷入困境:

test: post: - docker run -d -p 3000:3000 -e "SECRET_KEY_BASE=${SECRET_KEY}" eu.gcr.io/${PROJECT_NAME}/${MAIN_CONTAINER_NAME}:latest; sleep 10 - curl --retry 10 --retry-delay 5 -v http://localhost:3000 

这是一个简单的testing,validation我的泊坞窗图像能够回答一个http请求。 curl后我得到这个结果:

 * Rebuilt URL to: http://localhost:3000/ * Hostname was NOT found in DNS cache * Trying 127.0.0.1... * connect to 127.0.0.1 port 3000 failed: Connection refused * Failed to connect to localhost port 3000: Connection refused * Closing connection 0 curl: (7) Failed to connect to localhost port 3000: Connection refused curl --retry 10 --retry-delay 5 -v http://localhost:3000 returned exit code 7 

如果我在我的本地shell中尝试它,相同的命令工作。 我在本地得到这个结果:

 * Rebuilt URL to: http://localhost:3000/ * Trying ::1... * TCP_NODELAY set * Connected to localhost (::1) port 3000 (#0) > GET / HTTP/1.1 > Host: localhost:3000 > User-Agent: curl/7.51.0 > Accept: */* > * Curl_http_done: called premature == 0 * Empty reply from server * Connection #0 to host localhost left intact curl: (52) Empty reply from server 

我不明白这个区别的原因。