--net=host option does not seem to work
zerefel opened this issue · 5 comments
Expected behavior
Running a server on port 3000, in a container which exposes port 3000 should map the container to localhost:3000.
Actual behavior
Accessing localhost:3000 in the browser results in ERR_CONNECTION_REFUSED
. However, the container is started successfully and the server starts listening on port 3000.
Information
-
Diagnostic ID: 3F7A5024-D386-4782-8CBD-DFEB8343EE67/2017-07-19_21-23-58
-
OS: Windows 10
-
Docker version: 17.06.0-ce, build 02c1d87
-
Dockerfile:
FROM node:8
ADD package.json /tmp/package.json
RUN cd /tmp && npm install
RUN mkdir -p /usr/src/app && cp -a /tmp/node_modules /usr/src/app
RUN npm i -g forever
WORKDIR /usr/src/app
ADD . /usr/src/app
EXPOSE 3000
CMD npm run server:prod
Steps to reproduce the behavior
docker build -t sample_service .
docker run --net=host sample_service
Additional information
Running the same service in bridge mode docker run -p 3000:3000 sample_service
works just fine.
Same on Win10 and docker 17.12.0-ce, build c97c6d6. Connection refused to the port.
Not work by design, --net host is not supported on Docker for Windows.
Thanks for the reply. I moved to Linux because of other Docker bugs on Windows, sadly. Closing this issue.
Broken URL, any followup?
Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked