-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (25 loc) · 1.37 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
ARG PG_CONTAINER_VERSION=17
FROM docker.io/library/postgres:${PG_CONTAINER_VERSION}-bookworm AS builder
ARG DEBIAN_FRONTEND=noninteractive
RUN set -ex \
&& apt-get update \
&& apt-get install -y build-essential git postgresql-server-dev-${PG_MAJOR} pkg-config binutils automake libtool \
&& apt-get clean
RUN set -ex \
&& git clone --branch 1.2.3 --single-branch --depth 1 https://github.com/hightman/scws.git \
&& cd scws \
&& touch README;aclocal;autoconf;autoheader;libtoolize;automake --add-missing \
&& ./configure \
&& make install
RUN set -ex \
&& git clone --branch master --single-branch --depth 1 https://github.com/amutu/zhparser.git \
&& cd zhparser \
&& make install
FROM docker.io/library/postgres:${PG_CONTAINER_VERSION}-bookworm
RUN localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8
ENV LANG=zh_CN.UTF-8
COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/zhparser.so /usr/lib/postgresql/${PG_MAJOR}/lib/
COPY --from=builder /usr/local/lib/libscws.* /usr/local/lib/
COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/extension/zhparser* /usr/share/postgresql/${PG_MAJOR}/extension/
COPY --from=builder /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/zhparser* /usr/lib/postgresql/${PG_MAJOR}/lib/bitcode/
COPY --from=builder /usr/share/postgresql/${PG_MAJOR}/tsearch_data/*.utf8.* /usr/share/postgresql/${PG_MAJOR}/tsearch_data/