docker / for-win

Bug reports for Docker Desktop for Windows

Home Page:https://www.docker.com/products/docker#/windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

--net=host option does not seem to work

zerefel opened this issue · 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

  1. docker build -t sample_service .
  2. 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.

https://docs.docker.com/network/network-tutorial-host/#goal

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