Angular CLI Docker Images
Features
- Included all
@angular/cli
releases starts fromv1.0.0
except some buggy releases. - All tags are identical with the
@angular/cli
npm versions (npm view @angular/cli versions
) - Includes a default app created by
ng new
command that located in/app
folder. - Turn off Google Analytics by default.
Usage
Note: After container started, just navigate to https://localhost:4200 to see app running!
-
Simply run the default app using
Angular CLI v8.3.23
andng serve
command.docker run --name myapp --rm -d -p 4200:4200 willh/ngcli:8.3.23 npm start
With
--rm
argument, when container stopped, the container will be removed automatically. -
Enter container with
bash
usingAngular CLI v8.3.23
.docker run --name myapp --rm -it -p 4200:4200 willh/ngcli:8.3.23
With
--rm
argument, when container stopped, the container will be removed automatically. -
Mount your own app into container and run
npm install
inside container.docker run --name myapp --rm -it -v /ng8:/app willh/ngcli:8.3.23 npm install
-
Mount your own app (
G:\ng8
) into container and runnpm install
andnpm start
manually.docker run --name myapp --rm -it -p 4200:4200 -v G:\ng8:/app willh/ngcli:8.3.23 npm install ng serve --disable-host-check --host 0.0.0.0 --poll 1000
-
Mount empty folder (
G:\demo1
) into container and runng new
andnpm start
manually.mkdir g:\demo1 docker run --name myapp --rm -it -p 4200:4200 -v G:\demo1:/app willh/ngcli:8.3.23 cd / ng new app --routing --style css cd /app npm install ng serve --disable-host-check --host 0.0.0.0 --poll 1000
-
Mount empty folder (
G:\demo1
) into container and runng new
,npm start
andnpm test
manually.mkdir g:\demo1 docker run --name myapp --rm -it -p 4200:4200 -v G:\demo1:/app willh/ngcli:8.3.23 cd / ng new app --routing --style css cd /app npm install ng serve --disable-host-check --host 0.0.0.0 --poll 1000
docker exec -it myapp bash sed -i "s/browsers: \['Chrome'\],/browsers: ['ChromiumNoSandbox'],customLaunchers: {ChromiumNoSandbox: {base: 'ChromiumHeadless',flags: ['--no-sandbox','--headless','--disable-gpu','--disable-translate','--disable-extensions']}},/g" karma.conf.js prettier --single-quote --write karma.conf.js # 只跑一次 Karma Runner ng test --progress=false --code-coverage=true --watch=false # 監控資料夾變更,自動重跑 Karma Runner ng test --progress=false --code-coverage=true --poll=1000
docker exec -it myapp bash sed -i "s/browserName: 'chrome'/browserName: 'chrome', chromeOptions: {args: ['--no-sandbox','--headless','--disable-gpu','--disable-translate','--disable-extensions']}/g" e2e/protractor.conf.js prettier --single-quote --write e2e/protractor.conf.js ng e2e --dev-server-target= --webdriver-update=false
-
Check logs
docker logs myapp
-
Check logs continuously
docker logs myapp -f
-
Stop container
docker stop myapp
-
Remove container
docker rm myapp
Build notes
-
build.sh
Build all GA version from v7
-
build.beta.sh
Build all BETA version from v7
-
build.rc.sh
Build all RC version from v7
-
build.next.sh
Build all NEXT version from v7
-
build.v6.sh
Build all GA version for v6.x.x
-
build.v6.0.sh
Build all GA version for v6.0.x
-
build.v6.1.sh
Build all GA version for v6.1.x
-
build.v6.2.sh
Build all GA version for v6.2.x
-
build.v7.sh
Build all GA version for v7.x.x
-
build.v8.sh
Build all GA version for v8.x.x
-
build.v9.sh
Build all GA version for v9.x.x