Skip to content
This repository was archived by the owner on Dec 29, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ sudo yum install libmetalink
yum install libuuid-devel
```

###### Build docker images

```
docker build -f docker/Dockerfile.pg-alpine --build-arg POSTGRES_VERSION=13 .

docker build -f docker/Dockerfile.pg --build-arg POSTGRES_VERSION=13 .
```


Usage
-----

Expand Down
20 changes: 20 additions & 0 deletions docker/Dockerfile.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ARG POSTGRES_VERSION
FROM postgres:${POSTGRES_VERSION} as build

ARG POSTGRES_VERSION
RUN apt update && apt install -y cmake build-essential uuid-dev postgresql-server-dev-${POSTGRES_VERSION} libcurl4-openssl-dev pkg-config

ADD . /clickhouse-fdw-src
RUN rm -rf /clickhouse-fdw-src/build
WORKDIR /clickhouse-fdw-src

RUN mkdir -p build && cd build && cmake .. && make install

ARG POSTGRES_VERSION
FROM postgres:${POSTGRES_VERSION}

ARG POSTGRES_VERSION
RUN apt update && apt install -y libcurl4
COPY --from=build /usr/lib/postgresql/${POSTGRES_VERSION}/lib/* /usr/lib/postgresql/${POSTGRES_VERSION}/lib/
COPY --from=build /usr/share/postgresql/${POSTGRES_VERSION}/extension/* /usr/share/postgresql/${POSTGRES_VERSION}/extension/

17 changes: 17 additions & 0 deletions docker/Dockerfile.pg-alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG POSTGRES_VERSION
FROM postgres:${POSTGRES_VERSION}-alpine as build

# RUN apk --no-cache add clang-analyzer make musl-dev gcc g++ openssl-dev cmake curl-dev util-linux-dev
RUN apk --no-cache add make musl-dev gcc g++ openssl-dev cmake curl-dev util-linux-dev

ADD . /clickhouse-fdw-src
RUN rm -rf /clickhouse-fdw-src/build
WORKDIR /clickhouse-fdw-src

RUN mkdir -p build && cd build && cmake .. && make install

FROM postgres:${POSTGRES_VERSION}-alpine
RUN apk --no-cache add libcurl
COPY --from=build /usr/local/lib/postgresql/* /usr/local/lib/postgresql/
COPY --from=build /usr/local/share/postgresql/extension/* /usr/local/share/postgresql/extension/