Skip to content

Docker on windows - Automatic rebuild not triggered on save from host #5212

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

Closed
gavinbarron opened this issue Mar 3, 2017 · 9 comments
Closed

Comments

@gavinbarron
Copy link

OS?

Windows 10 + Docker CE Version 17.03.0-ce-win1 (10296) + node:latest

Versions.

root@3c96e8d8df57:/app/test-app# node --version
v7.6.0
root@3c96e8d8df57:/app/test-app# ng --version
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.0-rc.1
node: 7.6.0
os: linux x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.9

Repro steps.

Run up a new docker container with a mounted drive from PowerShell
Install @angular/cli
create a new app
serve the app
make changes from a text editor in the host machine and save
the app does not re-transpile

Commands run are listed below (output removed for brevity)

> docker run -it -p 4200:4200 -p 49153:49153 -v ${pwd}:/app -w /app node /bin/bash
root@3c96e8d8df57:/app# npm i -g @angular/cli
root@3c96e8d8df57:/app# ng new test-app --skip-npm
root@3c96e8d8df57:/app# cd test-app
root@3c96e8d8df57:/app/test-app# npm i 
root@3c96e8d8df57:/app/test-app# ng serve --host 0.0.0.0

Once the app is up and running I open the app folder with VSCode on my host machine and edit a file, for example removing the production mode check in main.ts and save the changes.
I would expect that this action triggers a rebuild of the app as happens when I do this right on the windows host machine

The log given by the failure.

** NG Live Development Server is running on http://0.0.0.0:4200 **
Hash: 8525d0713016ab84cf21
Time: 9365ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 153 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 3.45 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 9.77 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.69 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.

Mention any other details that might be useful.

Following all of the steps performed inside the container on the host machine results in the expected behavior

@clydin
Copy link
Member

clydin commented Mar 3, 2017

With your setup you may need to use the '--poll' option with a reasonable value based on your needs (value is in milliseconds).

@hansl
Copy link
Contributor

hansl commented Mar 3, 2017

Closing as working as intended.

@hansl hansl closed this as completed Mar 3, 2017
@gavinbarron
Copy link
Author

Thank you!!! that has solved the problem Legends :)

@Corsseir
Copy link

Corsseir commented Aug 11, 2017

'--poll' flag consumes a lot of cpu so this is not a solution.

@smoke
Copy link
Contributor

smoke commented Aug 11, 2017

@Corsseir my 2 cents - this is OS specific and currently I don't believe there is a better way in this combination - docker + Windows

@Corsseir
Copy link

Hm, ok. I though that Windows would be ok for web development since vagrant and docker but I was wrong. Its time to migrate to Linux I guess.

@holms
Copy link

holms commented Apr 23, 2018

--poll flag doesn't give any results at all, all ports opened, by changing template no webpack rebuild happens

@erensogut543
Copy link

erensogut543 commented Nov 21, 2018

@Corsseir as he said , after '--poll' my pc consume lots of cpu. Are there any way to ho reloding an angular app with docker ?

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants