To https://github.com/angular/angular/tree/master/tools/ngcontainer
alexeagle / ngcontainer Goto Github PK
View Code? Open in Web Editor NEWDocker image for running Angular build+test
License: MIT License
Docker image for running Angular build+test
License: MIT License
Please update chrome to the latest version. PR comment Link
The base image has not the latest version and it is not compatible with the latest chrome driver.
Installing global packages is working with ngcontainer:0.1.0
but the npm bin path doesn't seem to be correctly set.
The following log is taking from a circleci job using ngcontainer:0.1.0
, debugging via ssh. You can see that globally installing source-map-explorer
works, but which source-map-explorer
or source-map-explorer -v
does not. Printing $PATH
shows the bin path is not there.
2109310 correctly writes to ~/.profile
though, it just doesn't seem like it's used.
circleci@bde7a060d55c:~/angular-cli$ npm install -g source-map-explorer
/home/circleci/.npm-global/bin/source-map-explorer -> /home/circleci/.npm-global/lib/node_modules/source-map-explorer/index.js
+ [email protected]
added 21 packages in 0.996s
circleci@bde7a060d55c:~/angular-cli$ which source-map-explorer
circleci@bde7a060d55c:~/angular-cli$ source-map-explorer -v
bash: source-map-explorer: command not found
circleci@bde7a060d55c:~/angular-cli$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
circleci@bde7a060d55c:~/angular-cli$ cat ~/.profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
export PATH=~/.npm-global/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Currently we spend about 20-25s pulling the docker layers on each circle run, which is way too much.
See https://github.com/gregmagolan/circleci-build-container/blob/master/Dockerfile for a nearly equivalent image that boots faster.
/cc @gregmagolan
Hi Alex,
the 'latest' tag on docker hub points to 0.0.1 (maybe?). When I pull :0.0.5
I get a different image as compared to the latest.
Is that intended?
$ docker pull angular/ngcontainer
Using default tag: latest
latest: Pulling from angular/ngcontainer
Digest: sha256:95dbbd8b6114e2bae54ab745fa0aebc9f7f1ec934a206b76ce5147bfe8475a5d
Status: Downloaded newer image for angular/ngcontainer:latest
$ docker pull angular/ngcontainer:0.0.5
0.0.5: Pulling from angular/ngcontainer
3de546fb9d8f: Already exists
bcd6531038d3: Extracting [==================================================>] 157.9MB/157.9MB
8a076b6cf71a: Download complete
173629d1cd68: Download complete
In 0,7 (https://circleci.com/workflow-run/9766acd4-e4c6-4065-9c0f-6ed2732a8338) it is possible to do npm install -g
but the same doesn't seem possible with 0.8: https://circleci.com/gh/filipesilva/angular-cli/531
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/circleci/.npm/_logs/2018-01-02T18_56_15_223Z-debug.log
This sounds like the classic NPM permissions error: https://docs.npmjs.com/getting-started/fixing-npm-permissions.
I suppose the base node:8
image changed the npm default directory but circleci/node:8.9.2-browsers
does not?
I also seemed to have some trouble with workspaces on root (/workspace
dir). But that's not so bad because I can easily change it to ~/workspace
.
Soem of the Angular repos (like Angular CLI and devkit) use npm
instead of yarn
, but the current version of npm
on this container is 3.1, which does not contain support for package-lock.json
.
It is necessary to update npm
in order to use package locks on these repos. The version of node can remain the same though.
This is true for other docker images also, eg.
bazelbuild/bazel#1972 (comment)
Either need to change the debian kernel, or run the docker container with --privileged, or find a way to workaround /proc/xen.
Another workaround is to disable sandboxing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.