-
Notifications
You must be signed in to change notification settings - Fork 12k
-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with angular-cli and node docker official image. #4471
Comments
As per the readme (https://github.com/angular/angular-cli/blob/master/README.md#usage), you can set the bound host and port via the Can you provide an error log regarding the npm failure? |
Thanks for the reply
The issue is not related with bounding port perse, but with binding any bounded port from angular to a docker container, please read the related link in my previous post, to get some background. The port by default works fine from inside the container when I issue You can reproduce the issue as follow:docker pull node:6.9.5-alpine
docker run --name test -ti --rm -p 4200:4200 node:6.9.5-alpine sh From inside docker containernpm install angular-cli -g
ng new test1 --skip-npm
cd test1
npm install
ng server Then go to your browser and try apk --update add curl ca-certificates
curl http://localhost:4200 You will state that the connection is made without issues from inside the docker container. My docker environment information
Regards. UPDATE:I tried with the As I said before I'm new to angular, so there is a place where I can configure this option and set it as default in my project? About the other issue related with Thanks again. |
Under serve: {
"port": 4200,
"host": "0.0.0.0"
} |
Closing as answered, thanks @clydin and @delasteve ! |
Hi All, I tried the steps mentioned above by @omata-metamax and @delasteve I am still not able to load my app in the browser. Please let me know if I am missing anything. Below is my Dockerfile
Any help would be appreciated. Thanks! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Hello,
I'm new with angular, so I'm using the
node:6.9.4-alpine
to getangular-cli
installed to create a development docker image. So even when all is working I can't connect to the exposed port from outside the container. You can read the related history from here, where I posted the issue on the node official docker image and I figured out that the issue was not related with node image, but with angular-cli. Anyone has a clue about what is happening?angular-cli version:
Another issue that I found is related with project creation. when I issue
ng new project
it fails when npm is installing modules, but if I issueng new project --skip-npm
and then I runnpm install
it works without errors.Best regards.
The text was updated successfully, but these errors were encountered: