-
Notifications
You must be signed in to change notification settings - Fork 1
/
jumanpp.dockerfile
45 lines (38 loc) · 1.21 KB
/
jumanpp.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
ARG BASE_IMAGE=ubuntu:latest
FROM ${BASE_IMAGE} AS builder
# ARG should be placed after FROM
ARG JPP_VERSION=2.0.0-rc4
WORKDIR /app
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update -q && apt-get install -yq --no-install-recommends \
build-essential \
cmake \
ca-certificates \
g++ \
libprotobuf-dev \
make \
tar \
wget \
xz-utils \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Build and install Juman++
RUN wget "https://github.com/ku-nlp/jumanpp/releases/download/v${JPP_VERSION}/jumanpp-${JPP_VERSION}.tar.xz" -qO - \
| tar Jxf - \
&& mkdir "jumanpp-${JPP_VERSION}/bld" \
&& cd "jumanpp-${JPP_VERSION}/bld" \
&& cmake .. -DCMAKE_BUILD_TYPE=Release \
&& make -j "$([ "$(nproc)" -le 8 ] && nproc || echo "8")" \
&& make install
FROM ${BASE_IMAGE} AS runner
# Configure Japanese locale
RUN apt-get update -q && apt-get install -yq --no-install-recommends \
locales \
&& rm -rf /var/lib/apt/lists/* \
&& locale-gen ja_JP.UTF-8
ENV LANG="ja_JP.UTF-8" \
LANGUAGE="en_US" \
LC_ALL="ja_JP.UTF-8"
RUN localedef -f UTF-8 -i ja_JP ja_JP.utf8
COPY --from=builder /usr/local /usr/local
CMD ["/bin/bash"]