Skip to content

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

Closed

Description

@gavinbarron

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

Activity

  1. clydin commented on Mar 3, 2017

    @clydin
    Member

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

  2. hansl commented on Mar 3, 2017

    @hansl
    Contributor

    Closing as working as intended.

  3. gavinbarron commented on Mar 4, 2017

    @gavinbarron
    Author

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

  4. Corsseir commented on Aug 11, 2017

    @Corsseir

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

  5. smoke commented on Aug 11, 2017

    @smoke
    Contributor

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

  6. Corsseir commented on Aug 11, 2017

    @Corsseir

    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.

  7. holms commented on Apr 23, 2018

    @holms

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

  8. erensogut543 commented on Nov 21, 2018

    @erensogut543

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

  9. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  10. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions