Ports not binding to host

Expected behavior

-p 80:8080, I expect I can visit my localhost and see my server running in container.

Actual behavior

Nothing, timeout

Information

  • the output of:

  • Moby Menu > Diagnose & Feedback on OSX
    Docker for Mac: version: mac-v1.12.0-beta18-3-gec40b14
    OS X: version 10.11.5 (build: 15F34)
    logs: /tmp/20160706-211338.tar.gz
    [OK] docker-cli
    [OK] app
    [OK] menubar
    [OK] virtualization
    [OK] system
    [OK] osxfs
    [OK] db
    [OK] slirp
    [OK] moby-console
    [OK] logs
    [OK] vmnetd
    [OK] env
    [OK] moby
    [OK] driver.amd64-linux

  • a reproducible case if this is a bug, Dockerfiles FTW
    FROM node:4

MAINTAINER “Prasanth Vaaheeswaran”

ENV setup & dependencies

RUN mkdir -p /opt/dirtydish
COPY ./package.json /opt/dirtydish
RUN cd /opt/dirtydish && npm -q install

WORKDIR /opt/dirtydish/build

Database creation files

COPY ./build/database/migrations /opt/dirtydish/build/database/migrations
COPY ./build/database/bookshelf.js /opt/dirtydish/build/database
COPY ./build/database/knex.js /opt/dirtydish/build/database
COPY ./build/knexfile.js /opt/dirtydish/build

API server source

COPY ./build/config /opt/dirtydish/build/config
COPY ./build/index.js /opt/dirtydish/build
COPY ./build/lib /opt/dirtydish/build/lib

ENV ENVIRONMENT docker
EXPOSE 8080
CMD [“node”, “index.js”]
#ENTRYPOINT [“node”]

  • page URL if this is a docs issue or the name of a man page

  • host distribution and version ( OSX 10.10.x, OSX 10.11.x, Windows, etc )

osx 10.11.5

Steps to reproduce the behavior

#!/bin/bash
docker stop es db redis dirty-api
docker rm es db redis dirty-api
docker run -d --name db -p 5432:5432 -v pgData:/var/lib/postgresql/data -e POSTGRES_USER=dirtydish -e POSTGRES_DB=dirtydish -e POSTGRES_PASSWORD=dirtydish postgres:latest
docker run -d --name redis -p 6379:6379 -v redisData:/data redis redis-server --appendonly yes
docker run -d --name es -v “$PWD/config”/usr/share/elasticsearch/config -v esData:/user/share/elasticsearch/data -p 9200:9200 elasticsearch:latest
sleep 10s
docker run -d --name dirty-api -p 80:8080 --link es --link db:database --link redis vprasanth/dirty-api-production