Angular CLI image for testing purposes.
641
This is a minimal image with Node.js, Angular CLI and Chrome Headless for testing. This image is based on juanje/angular-cli, but it's a bit bigger, because of the Chrome and its dependencies.
For normal dev workflow, better use the juanje/angular-cli one. This one it just for testing with Chrome Headless. It can be used locally or at some CI server.
This image is very opinionated about the user and group ID. I made this for my teammates at Edosoft and at our workstations the user has UID=1001 and GUID=1001, so that is what I used. But you can rebuild the image using your UID and GUI.
Here you have the used Dockerfile:
Dockerfile.with_chrome
You can build your own image by running this command:
$ docker build . -f Dockerfile.with_chrome -t your_image_name
You can customize some options, like the UID and GUID, by passing them as --build-arg :
$ docker build --build-arg UID=1000 --build-arg GUID=1000 . -f Dockerfile.with_chrome -t your_image_name
This is useful if your normal user has another UID and GUID.
To avoid errors with Karma.js, be sure that you have this is your config file (karma.conf.js):
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: [
"--no-sandbox",
"--disable-web-security",
"--disable-gpu",
"--remote-debugging-port=9222"
]
}
},
node:13.2.0-alpine13.2.08.2.148.3.20You can run the tests from your Angular project running this command:
$ docker run -it --rm -v ${PWD}:/app juanje/angular-cli-chrome test --no-watch --no-progress
You can also use docker-compose. You can use this example:
version: '3'
services:
test:
image: juanje/angular-cli-chrome
container_name: angular-cli-testing
volumes:
- '.:/app'
entrypoint: 'ng test --no-watch --no-progress'
Now you can run:
$ docker-compose up
Content type
Image
Digest
Size
172.3 MB
Last updated
almost 7 years ago
docker pull juanje/angular-cli-chrome