From 1e9725ebeccced63816b055e0ce6137fc24ef61f Mon Sep 17 00:00:00 2001 From: kev Date: Wed, 23 Nov 2016 18:40:53 +0800 Subject: [PATCH] update phantomjs --- phantomjs/Dockerfile | 8 +++++++- phantomjs/selenium/Dockerfile | 25 +++++++++++++++++++++++++ phantomjs/selenium/docker-compose.yml | 8 ++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 phantomjs/selenium/Dockerfile create mode 100644 phantomjs/selenium/docker-compose.yml diff --git a/phantomjs/Dockerfile b/phantomjs/Dockerfile index a30a444..debcc39 100644 --- a/phantomjs/Dockerfile +++ b/phantomjs/Dockerfile @@ -5,6 +5,8 @@ FROM ubuntu:14.04 MAINTAINER kev +ENV PHANTOMJS_VERSION 2.1.1 + RUN set -xe \ && apt-get update \ && apt-get install -y bison \ @@ -25,8 +27,12 @@ RUN set -xe \ perl \ python \ ruby \ - && git clone -b 2.1 --depth 1 --single-branch git://github.com/ariya/phantomjs.git \ + && git clone git://github.com/ariya/phantomjs.git \ && cd phantomjs \ + && git checkout PHANTOMJS_VERSION \ + && git submodule init \ + && git submodule update \ + && sed -i '/platform:/s@^@//@' src/ghostdriver/hub_register.js \ && echo y | ./build.py 2>/dev/null 1>&2 \ && install -v -s -m 755 bin/phantomjs /usr/local/bin/ \ && cd .. \ diff --git a/phantomjs/selenium/Dockerfile b/phantomjs/selenium/Dockerfile new file mode 100644 index 0000000..b7e2ea4 --- /dev/null +++ b/phantomjs/selenium/Dockerfile @@ -0,0 +1,25 @@ +# +# Dockerfile for selenium-node-phantomjs +# + +FROM debian:jessie +MAINTAINER kev + +ENV PHANTOMJS_VER 2.1.1 +ENV PHANTOMJS_URL https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VER}-linux-x86_64.tar.bz2 +ENV PHANTOMJS_BIN phantomjs-${PHANTOMJS_VER}-linux-x86_64/bin/phantomjs + +RUN set -xe \ + && apt-get update \ + && apt-get install -y bzip2 curl libfontconfig \ + && curl -sSL ${PHANTOMJS_URL} | tar xj -C /usr/local/bin --strip 2 ${PHANTOMJS_BIN} \ + && apt-get remove -y bzip2 curl \ + && rm -rf /var/lib/apt/lists/* + +ENV HOST 0.0.0.0 +ENV PORT 5555 +ENV HUB_HOST 127.0.0.1 +ENV HUB_PORT 4444 + +CMD phantomjs --webdriver=$HOST:$PORT \ + --webdriver-selenium-grid-hub=http://$HUB_HOST:$HUB_PORT diff --git a/phantomjs/selenium/docker-compose.yml b/phantomjs/selenium/docker-compose.yml new file mode 100644 index 0000000..2591636 --- /dev/null +++ b/phantomjs/selenium/docker-compose.yml @@ -0,0 +1,8 @@ +phantomjs: + image: vimagick/selenium-node-phantomjs + ports: + - "5555" + environment: + - HUB_HOST=1.2.3.4 + - HUB_PORT=4444 + restart: always