Skip to content
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

Chrome doesn't start #3

Closed
emmenko opened this issue Aug 21, 2015 · 5 comments
Closed

Chrome doesn't start #3

emmenko opened this issue Aug 21, 2015 · 5 comments

Comments

@emmenko
Copy link

emmenko commented Aug 21, 2015

Hey, I'm struggling to make chrome start and found your repo so I thought to give it a try.
Unfortunately it doesn't seem to work :(

emmenko: ~/dev/src/docker-chromium-xvfb/samples/js (master)
$ docker run -it --rm -v $(pwd):/src -w /src markadams/chromium-xvfb-js
npm info it worked if it ends with ok
npm info using npm@2.7.4
npm info using node@v1.6.3
npm info pretest sample-app@1.0.0
npm info test sample-app@1.0.0

> sample-app@1.0.0 test /src
> ./node_modules/karma/bin/karma start

INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again (1/2).
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again (2/2).
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
ERROR [launcher]: Chrome failed 2 times (timeout). Giving up.
npm info sample-app@1.0.0 Failed to exec test script
npm ERR! Test failed.  See above for more details.

Any idea what's wrong?

@mark-adams
Copy link
Contributor

You're totally right! A while back (4668e4), I split out the Dockerfiles into :latest and :latest-onbuild. This was done primarily to mirror other similar Docker images (like Python) and give people an option of running or not running with the ONBUILD helpers in the Dockerfile.

When I did this, I neglected to update the samples to use :latest-onbuild. I'll be submitting a PR in a moment to fix that.

@mark-adams
Copy link
Contributor

@emmenko If you rebuild and try again you should see better results now. Thanks for reporting!

@emmenko
Copy link
Author

emmenko commented Aug 22, 2015

Hey thanks for the response but it doesn't seem to work either, or am I doing something wrong?

emmenko: ~/dev/src/docker-chromium-xvfb/samples/js (master)
$ docker run -it --rm -v $(pwd):/src -w /src markadams/chromium-xvfb-js:latest-onbuild
Unable to find image 'markadams/chromium-xvfb-js:latest-onbuild' locally
Pulling repository docker.io/markadams/chromium-xvfb-js
009fb9b301c1: Download complete
2c49f83e0b13: Download complete
4a5e6db8c069: Download complete
0c3983383292: Download complete
72ec16c15979: Download complete
bdd5f5be1dab: Download complete
3828dacce5e5: Download complete
0eab979f77cd: Download complete
bfd1bc98aacf: Download complete
ab7bcb241e94: Download complete
22517a61ff4c: Download complete
a9b2e4506632: Download complete
f9499bc842cf: Download complete
8a7b8b538e6d: Download complete
1d3d6d89f876: Download complete
cd201f866f52: Download complete
b2c5aef600fa: Download complete
Status: Downloaded newer image for markadams/chromium-xvfb-js:latest-onbuild
npm info it worked if it ends with ok
npm info using npm@2.7.4
npm info using node@v1.6.3
npm info pretest sample-app@1.0.0
npm info test sample-app@1.0.0

> sample-app@1.0.0 test /src
> ./node_modules/karma/bin/karma start

INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again (1/2).
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again (2/2).
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
ERROR [launcher]: Chrome failed 2 times (timeout). Giving up.
npm info sample-app@1.0.0 Failed to exec test script
npm ERR! Test failed.  See above for more details.

@mark-adams
Copy link
Contributor

To run the sample, you should run something like this:

docker build -t js-sample .
docker run --rm js-sample

My output of docker run --rm js-sample looks like this:

$ docker run --rm js-sample
npm info it worked if it ends with ok
npm info using npm@2.7.4
npm info using node@v1.6.3
npm info pretest sample-app@1.0.0
npm info test sample-app@1.0.0

> sample-app@1.0.0 test /usr/src/app
> ./node_modules/karma/bin/karma start

INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 44.0.2403 (Linux 0.0.0)]: Connected on socket 45IvsPFs7hg4lOZAUq2T with id 72750351
Chrome 44.0.2403 (Linux 0.0.0): Executed 1 of 1 SUCCESS (0.006 secs / 0.001 secs)
npm info posttest sample-app@1.0.0
npm info ok

@emmenko
Copy link
Author

emmenko commented Aug 22, 2015

Hmm I guess it's because of the ONBUILD instruction that you need to build an image in order to execute the triggers.

But for me I don't see the need to build an image if you just want to run something, especially if you can mount a volume. I've actually manage to make it work like this:

# https://hub.docker.com/r/emmenko/nodejs-karma/
$ cmd="docker run -it --rm -v $(pwd):/src -w /src -e NODE_ENV=test emmenko/nodejs-karma:0.2.0"
$ eval "$cmd sh -c 'npm i --unsafe-perm --no-optional'"
$ eval "$cmd sh -c 'npm run lint && /src/node_modules/.bin/karma start karma.config.js'"

Anyway, I guess those are 2 different approaches and if you use ONBUILD you need to build an image as an extra step.

Thanks for the help anyway :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants