Skip to content

Instantly share code, notes, and snippets.

@orca8
Created May 22, 2017 16:22
Show Gist options
  • Save orca8/a9ecc1adb933ed73e2d9c06a5cca5247 to your computer and use it in GitHub Desktop.
Save orca8/a9ecc1adb933ed73e2d9c06a5cca5247 to your computer and use it in GitHub Desktop.
Dockerfile phantomjs + casperjs + 日本語フォント付き
FROM centos:7
ENV PHANTOMJS_VERSION=phantomjs-2.1.1-linux-x86_64
RUN yum update -y && \
yum install -y bzip2 unzip fontconfig git && \
yum clean all
# install phantomjs
RUN curl -L -O https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOMJS_VERSION.tar.bz2
RUN tar xvf $PHANTOMJS_VERSION.tar.bz2
RUN mv $PHANTOMJS_VERSION/bin/phantomjs /usr/local/bin/
RUN rm -rf phantomjs*
# install 日本語フォント
WORKDIR /root
RUN curl -L -O http://dl.ipafont.ipa.go.jp/IPAexfont/IPAexfont00301.zip
RUN unzip IPAexfont00301.zip
RUN mkdir .fonts
RUN cp IPAexfont00301/*.ttf .fonts
RUN fc-cache -fv
# install casperjs
RUN git clone git://github.com/casperjs/casperjs.git
RUN mv casperjs /opt/
RUN ln -sf /opt/casperjs/bin/casperjs /usr/local/bin/casperjs
RUN mkdir /home/casperjs
WORKDIR /home/casperjs
ENTRYPOINT ["casperjs"]
CMD ["--version"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment