GithubHelp home page GithubHelp logo

Comments (5)

mark-adams avatar mark-adams commented on June 23, 2024

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.

from docker-chromium-xvfb.

mark-adams avatar mark-adams commented on June 23, 2024

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

from docker-chromium-xvfb.

emmenko avatar emmenko commented on June 23, 2024

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 [email protected]
npm info using [email protected]
npm info pretest [email protected]
npm info test [email protected]

> [email protected] 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 [email protected] Failed to exec test script
npm ERR! Test failed.  See above for more details.

from docker-chromium-xvfb.

mark-adams avatar mark-adams commented on June 23, 2024

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 [email protected]
npm info using [email protected]
npm info pretest [email protected]
npm info test [email protected]

> [email protected] 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 [email protected]
npm info ok

from docker-chromium-xvfb.

emmenko avatar emmenko commented on June 23, 2024

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 :)

from docker-chromium-xvfb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.