-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (51 loc) · 2.02 KB
/
Copy pathDockerfile
File metadata and controls
63 lines (51 loc) · 2.02 KB
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
FROM nvidia/cuda:8.0-cudnn6-runtime
MAINTAINER tanaka504 <nishikigi.nlp@gmail.com>
# apt-get
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install git vim curl locales mecab libmecab-dev mecab-ipadic-utf8 make xz-utils file sudo bzip2 wget python3-pip swig
RUN apt-get -y install libssl-dev libbz2-dev libreadline-dev libsqlite3-dev
# install pyenv
ENV HOME /home
RUN git clone https://github.com/yyuu/pyenv.git $HOME/.pyenv
ENV PYENV_ROOT $HOME/.pyenv
ENV PATH $PYENV_ROOT/bin:$PATH
RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc && \
eval "$(pyenv init -)"
RUN pyenv install 3.6.0
RUN pyenv global 3.6.0
# install python3 packages
RUN pip3 install --upgrade pip
RUN pip3 install mecab-python3
# character encoding
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# install CRF++
WORKDIR /usr/src/
RUN wget 'https://docs.google.com/uc?export=download&id=0B4y35FiV1wh7QVR6VXJ5dWExSTQ' -O CRF++-0.58.tar.gz
RUN tar xf CRF++-0.58.tar.gz
WORKDIR CRF++-0.58/
RUN ./configure --prefix=$HOME/usr
RUN make && make install
# install CaboCha
RUN curl -sc /tmp/gcokie "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7SDd1Q1dUQkZQaUU" > /dev/null
RUN getcode="$(awk '/_warning_/ {print $NF}' /tmp/gcokie)"
RUN curl -Lb /tmp/gcokie "https://drive.google.com/uc?export=download&confirm=${getcode}&id=0B4y35FiV1wh7SDd1Q1dUQkZQaUU" -o cabocha-0.69.tar.bz2
RUN tar xvf cabocha-0.69.tar.bz2
RUN cd cabocha-0.69
RUN export LDFLAGS="-L$HOME/usr/lib"
RUN export CPPFLAGS="-I$HOME/usr/include"
RUN ./configure --with-mecab-config=$HOME/usr/bin/mecab-config --with-charset=UTF8 --prefix=$HOME/usr
RUN make && make install
# python setup.py build
# python setup.py --user install
# add MeCab Neologd
WORKDIR /usr/src/
RUN git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git /usr/src/mecab-ipadic-neologd && \
/usr/src/mecab-ipadic-neologd/bin/install-mecab-ipadic-neologd -n -y
RUN mecab -d /usr/local/lib/mecab/dic/mecab-ipadic-neologd/
ADD . /home/DA_conv/
WORKDIR /home/
CMD ["/bin/bash"]