Skip to content

Instantly share code, notes, and snippets.

@domderen
Created April 19, 2016 13:29
Show Gist options
  • Save domderen/fef6d46a600c69bcc6f95a5c2cdad240 to your computer and use it in GitHub Desktop.
Save domderen/fef6d46a600c69bcc6f95a5c2cdad240 to your computer and use it in GitHub Desktop.
# dockerhub - A repository for various dockerfiles
# For more information; http://github.com/cmfatih/dockerhub
#
# SlimerJS
#
# Test
# sudo docker run fentas/slimerjs /usr/bin/slimerjs -v
# sudo docker run fentas/slimerjs /usr/bin/casperjs | head -n 1
# sudo docker run -v `pwd`:/mnt/test fentas/slimerjs /usr/bin/slimerjs /mnt/test/test.js
# VERSION 1.0.1
FROM ubuntu:12.04
MAINTAINER fentas <[email protected]>
# Env
ENV SLIMERJS_VERSION_F 0.10.0pre
ENV CASPERJS_VERSION_T master
ENV SLIMERJSLAUNCHER=/usr/bin/firefox
ADD fix.data ./
# Commands
RUN \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y vim git wget xvfb libxrender-dev libasound2 libdbus-glib-1-2 libgtk2.0-0 zip bzip2 && \
mkdir -p /srv/var && \
wget -O /tmp/slimerjs-$SLIMERJS_VERSION_F.zip http://download.slimerjs.org/nightlies/latest-slimerjs-master/slimerjs-$SLIMERJS_VERSION_F.zip && \
unzip /tmp/slimerjs-$SLIMERJS_VERSION_F.zip -d /tmp && \
rm -f /tmp/slimerjs-$SLIMERJS_VERSION_F.zip && \
mv /tmp/slimerjs-$SLIMERJS_VERSION_F/ /srv/var/slimerjs && \
cat /fix.data > /srv/var/slimerjs/vendors/ghostdriver/logger.js && \
echo '#!/bin/bash\nxvfb-run /srv/var/slimerjs/slimerjs $*' > /srv/var/slimerjs/slimerjs.sh && \
chmod 755 /srv/var/slimerjs/slimerjs.sh && \
ln -s /srv/var/slimerjs/slimerjs.sh /usr/bin/slimerjs && \
wget -O /tmp/firefox-45.0.tar.bz2 http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/45.0/linux-x86_64/en-US/firefox-45.0.tar.bz2 && \
tar xvjf /tmp/firefox-45.0.tar.bz2 -C /tmp && \
rm -f /tmp/firefox-45.0.tar.bz2 && \
ls -lah /tmp && \
mv /tmp/firefox/ /srv/var/firefox && \
ln -s /srv/var/firefox/firefox /usr/bin/firefox && \
apt-get autoremove -y && \
apt-get clean all
ADD join-hub.sh /usr/local/bin/
ADD wait-for-it.sh ./
RUN chmod +x ./wait-for-it.sh
RUN chmod +x /usr/local/bin/join-hub.sh
ENTRYPOINT ["sh", "-c", "./wait-for-it.sh hub:4444 -- /usr/local/bin/join-hub.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment