Skip to content

Instantly share code, notes, and snippets.

@moznion
Created July 22, 2025 12:19
Show Gist options
  • Save moznion/0dd005a604dba7641e5ca07c38329c6b to your computer and use it in GitHub Desktop.
Save moznion/0dd005a604dba7641e5ca07c38329c6b to your computer and use it in GitHub Desktop.
FROM debian:bookworm-slim
ENV LANG=C.utf8
RUN apt-get update -y \
&& apt-get install -y \
git \
pkg-config \
build-essential \
mecab \
mecab-ipadic-utf8 \
libmecab-dev \
libsvm-dev \
wget \
unzip \
autoconf \
automake \
libtool
RUN wget 'https://downloads.sourceforge.net/project/icu/ICU4C/59.1/icu4c-59_1-src.tgz?r=http%3A%2F%2Fapps.icu-project.org%2Ficu-jsp%2FdownloadSection.jsp%3Fver%3D59.1%26base%3Dcs%26svn%3Drelease-59-1&ts=1497872621&use_mirror=jaist' -O /tmp/icu4c-59_1-src.tgz \
&& cd /tmp \
&& tar zxf icu4c-59_1-src.tgz \
&& cd icu/source \
&& ln -s /usr/include/locale.h /usr/include/xlocale.h \
&& ./configure \
&& make \
&& make install \
&& ldconfig \
&& rm -rf /tmp/icu4c-59_1-src.tgz /tmp/icu
RUN git clone -b v1.2.5 https://github.com/grpc/grpc /tmp/grpc \
&& cd /tmp/grpc \
&& git submodule update --init \
&& cd third_party/protobuf \
&& autoreconf -fiv \
&& cd ../../ \
# [workaround] to avoid `error: conflicting types for 'gettid'; have 'long int(void)'` \
&& sed -i'' -e's/static long gettid(void) { return syscall(__NR_gettid); }//' src/core/lib/support/log_linux.c \
&& make CFLAGS="-w -std=c11" CXXFLAGS="-w -std=c++14" \
&& make install \
&& cd third_party/protobuf \
&& make \
&& make install \
&& ldconfig \
&& rm -rf /tmp/grpc
RUN cd /tmp \
&& git clone https://github.com/tuem/resembla \
&& cd /tmp/resembla/src \
&& git checkout ff39ac1b6904fc018bb691d77ca468772600f731 \
# [workaround] see also: https://github.com/tuem/resembla/pull/5 \
&& sed -i'' -e's/#include <unordered_set>/#include <cstddef>\n#include <unordered_set>/' measure/romaji_weight.hpp \
&& make \
&& make install \
&& cd executable \
&& make \
&& make install \
&& ldconfig \
&& rm -rf /tmp/resembla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment