for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

docker-compose port expose not working on mac 10.13.6 (High Sierra)

Open umair-khokhar opened this issue 8 years ago • 2 comments

I have a docker container that hosts a Node application. I am trying to connect the application using following URL https://localhost:8000, but the connection is refused. I used docker-compose up -d command to run it.

The response of docker-compose ps is


            Name                  Command      State           Ports         
-----------------------------------------------------------------------------
freeswitch-console_console_1   nodemon start   Up      0.0.0.0:8000->8000/tcp

My docker-compose file is

version: '3'
services:
  console:
    build: .
    ports:
    - "8000:8000"
    image: console:cp
    volumes:
    - .:/usr/src/app
    - /usr/src/app/node_modules

And my Dockerfile is

FROM node:10

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)

RUN npm install -g nodemon

COPY package*.json ./


RUN npm install
# If you are building your code for production
# RUN npm install --only=production

# Bundle app source
COPY . .

EXPOSE 8000
CMD [ "nodemon", "start" ]

I tried following command and it didn't work either:

docker run -p 8000:8000 console:cp nodemon index.js

Some more details

docker-compose version 1.22.0, build f46880f
Docker version 18.06.0-ce, build 0ffa825
MacOSX 10.13.6 (High Sierra)

Any ideas? Thanks in advance.

umair-khokhar avatar Aug 17 '18 19:08 umair-khokhar

I had userland-proxy defined in my advanced daemon settings. Removing that did the trick.

umair-khokhar avatar Oct 03 '18 18:10 umair-khokhar

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

docker-robott avatar Jun 29 '20 03:06 docker-robott