本地主机连接重置由同行,docker容器(ubuntu)运行angularjs webpack应用程序

我正在使用下面的dockerfile在一个Ubuntu容器中运行我的web应用程序:

# docker.webpack test enviroment FROM ubuntu:latest WORKDIR / COPY . / RUN apt-get update RUN apt-get install fish -y RUN apt-get install curl -y RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && apt-get install nodejs -y RUN npm install webpack -g RUN npm install RUN npm run build #RUN npm run webpack-dev-server prøver med cmd i stedet CMD npm run webpack-dev-server 

我使用docker run -p 1384:1483 epdspa启动应用程序,返回:

 > epd-portal-spa@1.0.0 webpack-dev-server / > webpack-dev-server --open --inline Project is running at http://localhost:1384/ webpack output is served from / Content not from webpack is served from ./public/ Hash: 80935d7e0983c2034300 Version: webpack 3.8.1 Time: 9870ms 

但是,当我运行curl localhost:1384我得到:

 curl: (56) Recv failure: Connection reset by peer 

我也从本地机器上的terminal窗口运行以下命令:

 netstat -pnlt | grep :1384 tcp6 0 0 :::1384 :::* LISTEN - 

为什么只有一个Ipv6版本我不确定,

 route 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0 

有关dockernetworkingconfiguration的更多信息:

 '[ { "Name": "bridge", "Id": "d7c753e63270be9aae2af38ab1044966c066ad6e69fec0f95e28c7e3c850ff23", "Created": "2017-12-01T08:08:51.677254348+01:00", "Scope": "local", "Driver": "bridge", "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": null, "Config": [ { "Subnet": "172.17.0.0/16", "Gateway": "172.17.0.1" } ] }, "Internal": false, "Attachable": false, "Ingress": false, "ConfigFrom": { "Network": "" }, "ConfigOnly": false, "Containers": { "21bcc48764a7245a5f8ef851e3e16774e91d0447fac6fc614089b5b917b71b31": { "Name": "angry_bassi", "EndpointID": "c744a2a7f2596d743ed91756f846d455967bb634292190c69789b447cca5ca2d", "MacAddress": "02:42:ac:11:00:02", "IPv4Address": "172.17.0.2/16", "IPv6Address": "" } }, "Options": { "com.docker.network.bridge.default_bridge": "true", "com.docker.network.bridge.enable_icc": "true", "com.docker.network.bridge.enable_ip_masquerade": "true", "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", "com.docker.network.bridge.name": "docker0", "com.docker.network.driver.mtu": "1500" }, "Labels": {} } ] 

我很确定Docker CLI中有一些[OPTIONS],[COMMAND]或[ARG ..],但是我似乎无法从文档中find它。