-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# Dockerfile for casperjs | ||
# | ||
|
||
FROM debian:jessie | ||
MAINTAINER kev <[email protected]> | ||
|
||
ENV PHANTOM_URL https://github.com/vimagick/dockerfiles/raw/master/webkit/bin/phantomjs | ||
ENV CASPER_URL https://github.com/n1k0/casperjs/archive/master.tar.gz | ||
ENV CASPER_DIR /usr/local/lib/casperjs/ | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y curl \ | ||
libfontconfig \ | ||
libicu52 \ | ||
python \ | ||
&& curl -sSL $PHANTOM_URL -o /usr/local/bin/phantomjs \ | ||
&& chmod +x /usr/local/bin/phantomjs \ | ||
&& mkdir -p $CASPER_DIR \ | ||
&& curl -sSL $CASPER_URL | tar xz --strip 1 -C $CASPER_DIR \ | ||
&& sed -i '/Warning PhantomJS v2.0 not yet released/s@^@//@' $CASPER_DIR/bin/bootstrap.js \ | ||
&& ln -sf $CASPER_DIR/bin/casperjs /usr/local/bin/ \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY ./libjpeg.so.8 /usr/lib/x86_64-linux-gnu/ | ||
COPY ./sample.js /app/ | ||
|
||
VOLUME /app/ | ||
WORKDIR /app/ | ||
|
||
ENTRYPOINT ["casperjs"] | ||
CMD ["--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
casperjs | ||
======== | ||
|
||
[CasperJS][1] is a navigation scripting & testing utility for PhantomJS and SlimerJS | ||
written in Javascript. | ||
|
||
## Quick Start | ||
|
||
``` | ||
$ alias casperjs='docker run --rm -v `pwd`:/app vimagick/casperjs' | ||
$ wget https://raw.githubusercontent.com/vimagick/dockerfiles/master/casperjs/sample.js | ||
$ casperjs sample.js | ||
CasperJS, a navigation scripting and testing utility for PhantomJS and SlimerJS | ||
PhantomJS | PhantomJS | ||
``` | ||
|
||
[1]: http://casperjs.org/ |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var casper = require('casper').create(); | ||
|
||
casper.start('http://casperjs.org/', function() { | ||
this.echo(this.getTitle()); | ||
}); | ||
|
||
casper.thenOpen('http://phantomjs.org', function() { | ||
this.echo(this.getTitle()); | ||
}); | ||
|
||
casper.run(); |