Skip to content

Commit f954eb3

Browse files
committed
init
1 parent 97fe32d commit f954eb3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# seq uuid: https://github.com/tvondra/sequential-uuids
2+
# ref: https://github.com/docker-library/postgres/issues/340
3+
FROM postgres:13 AS extension_builder
4+
5+
# Already download extension code
6+
RUN cd /
7+
RUN mkdir external_extensions
8+
RUN mkdir /external_extensions/sequential-uuids
9+
COPY lib/sequential-uuids/ /external_extensions/sequential-uuids/
10+
WORKDIR /external_extensions/sequential-uuids/
11+
12+
# additional: change sources.list, but postgres source is still slow. don't need if proxy is used.
13+
# RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" > /etc/apt/sources.list
14+
# RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list
15+
# RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >> /etc/apt/sources.list
16+
# RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list
17+
18+
19+
RUN apt-get update && apt install build-essential libicu-dev postgresql-server-dev-all -y --no-install-recommends
20+
RUN make clean && make install
21+
22+
FROM postgres:13
23+
#if use alpine: the paths are different!
24+
25+
# run find / -name 'sequential_uuids*' to find newly compiled files and copy to next stage
26+
COPY --from=extension_builder /usr/lib/postgresql/12/lib /usr/lib/postgresql/13/lib
27+
COPY --from=extension_builder /usr/share/postgresql/12/extension /usr/share/postgresql/13/extension
28+
29+
# after in sql:
30+
# CREATE EXTENSION sequential_uuids;

0 commit comments

Comments
 (0)