Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phantomJS on docker containers

I am having a few issues with adding PhantomJS to our website docker containers.

I got 2 containers test and production but have no idea how to add it to each of these containers.

The containers are made with Dokku and are already running. This is a bit different so we are not able to pull up fresh containers with images or edit their Dockerfiles

Additionally we have managed to use commands like wget in them using dokku run, but this is not an interactive shell. Also the files downloaded with wget don't appear to be in the container when checking with ls even though the download finishes.

like image 878
Chou One Avatar asked Dec 12 '22 05:12

Chou One


1 Answers

I would add to the Dockerfile something like:

# PhantomJS
ENV PHANTOMJS_VERSION 1.9.7
RUN wget --no-check-certificate -q -O - https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 | tar xjC /opt
RUN ln -s /opt/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
like image 164
Filippo Vitale Avatar answered Feb 14 '23 00:02

Filippo Vitale