-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
92 lines (84 loc) · 3.13 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
FROM rocker/tidyverse:latest
MAINTAINER "ymattu"
## Add LaTeX, rticles and bookdown support
## uses dummy texlive, see FAQ 8: https://yihui.name/tinytex/faq/
RUN wget "https://travis-bin.yihui.name/texlive-local.deb" \
&& dpkg -i texlive-local.deb \
&& rm texlive-local.deb \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
## for rJava
default-jdk \
## Nice Google fonts
fonts-roboto \
## IPAex Fonts
fonts-ipaexfont \
## used by some base R plots
ghostscript \
## used to build rJava and other packages
libbz2-dev \
libicu-dev \
liblzma-dev \
## system dependency of hunspell (devtools)
libhunspell-dev \
## system dependency of hadley/pkgdown
libmagick++-dev \
## rdf, for redland / linked data
librdf0-dev \
## for V8-based javascript wrappers
libv8-dev \
## for jq queries
libjq-dev \
## R CMD Check wants qpdf to check pdf sizes, or throws a Warning
qpdf \
## For building PDF manuals
texinfo \
## for git via ssh key
ssh \
## just because
less \
vim \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
## Use tinytex for LaTeX installation
&& wget -qO- \
"https://github.com/yihui/tinytex/raw/master/tools/install-unx.sh" | \
sh -s - --admin --no-path \
&& mv ~/.TinyTeX /opt/TinyTeX \
&& /opt/TinyTeX/bin/*/tlmgr path add \
&& tlmgr install metafont mfware inconsolata tex ae parskip listings \
&& tlmgr path add \
&& Rscript -e "source('https://install-github.me/yihui/tinytex'); tinytex::r_texmf()" \
&& chown -R root:staff /opt/TinyTeX \
&& chmod -R g+w /opt/TinyTeX \
&& chmod -R g+wx /opt/TinyTeX/bin \
## And some nice R packages for publishing-related stuff
&& install2.r --error --deps TRUE \
bookdown rticles rmdshower DT
## Mecab
RUN wget -O mecab-0.996.tar.gz "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE" ;\
tar -xzf mecab-0.996.tar.gz ;\
cd mecab-0.996; ./configure --enable-utf8-only; make; make install; ldconfig
## Ipadic
RUN wget -O mecab-ipadic-2.7.0-20070801.tar.gz "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7MWVlSDBCSXZMTXM" ;\
tar -xzf mecab-ipadic-2.7.0-20070801.tar.gz ;\
cd mecab-ipadic-2.7.0-20070801; ./configure --with-charset=utf8; make; make install ;\
echo "dicdir = /usr/local/lib/mecab/dic/ipadic" > /usr/local/etc/mecabrc
## Clean up
RUN apt remove -y build-essential ;\
rm -rf rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* ;\
rm -rf mecab-0.996.tar.gz* ;\
rm -rf mecab-ipadic-2.7.0-20070801*
## Change environment to Japanese(Character and DateTime)
ENV LANG ja_JP.UTF-8
ENV LC_ALL ja_JP.UTF-8
RUN sed -i '$d' /etc/locale.gen \
&& echo "ja_JP.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen ja_JP.UTF-8 \
&& /usr/sbin/update-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"
RUN /bin/bash -c "source /etc/default/locale"
RUN ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
## Install additional R packages
RUN Rscript -e "install.packages(c('githubinstall','tm','slam', 'tidytext'))"
RUN Rscript -e "install.packages('RMeCab',repos='http://rmecab.jp/R')"
CMD ["/init"]