mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-02-01 13:17:47 +02:00
add casperjs
This commit is contained in:
parent
a7638ef8b2
commit
ef9113aec0
32
casperjs/Dockerfile
Normal file
32
casperjs/Dockerfile
Normal file
@ -0,0 +1,32 @@
|
||||
#
|
||||
# Dockerfile for casperjs
|
||||
#
|
||||
|
||||
FROM debian:jessie
|
||||
MAINTAINER kev <noreply@datageek.info>
|
||||
|
||||
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"]
|
17
casperjs/README.md
Normal file
17
casperjs/README.md
Normal file
@ -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/
|
BIN
casperjs/libjpeg.so.8
Normal file
BIN
casperjs/libjpeg.so.8
Normal file
Binary file not shown.
11
casperjs/sample.js
Normal file
11
casperjs/sample.js
Normal file
@ -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();
|
Loading…
x
Reference in New Issue
Block a user