I have an Angular application deployed in the container . If I log in to the container I can curl to the port 4200.

I have mapped to port 9001 to connect from my host .

But I can't curl from my host machine. What could be the issue? I think I should configure with docker bridge how to do that??

My Docker file:

FROM alpine:latest

#installing required pakages
RUN apk update
RUN apk fix
RUN apk add nodejs nodejs-npm apache2 curl yarn
RUN npm install -g @angular/cli
RUN npm install -g typescript
RUN mkdir -p /var/opt/angular


COPY . .

WORKDIR /opt/frontend

RUN npm install
RUN ng build
COPY start.sh /opt/frontend/start.sh
RUN chmod +x start.sh

CMD ["sh", "start.sh"]

Start-up script(start.sh):


ng serve --host

While running the docker file I have specified. -p 9001:4200

  • please add your Dockerfile.
    – profesor79
    Sep 2, 2019 at 8:00
  • A suggestion for your dockerfile, merge RUN commands like RUN command1 && command2 to reduce the layers created and the image size. Sep 3, 2019 at 20:51

1 Answer 1


Since you are using the tag "Docker-Machine" I'm assuming that you are using Docker Toolbox to manage Docker. The problem is most likely an issue with Virtual Box configuration than your Docker configuration.

When you try pinging your container on port 9001, use the ip instead of or localhost. Another way to test would be to get the IP address of the docker-machine, docker-machine ip, and use this IP to ping your container (e.g. use

If you are trying to access the container from another computer you may have to look into a solution like port forwarding as described here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.