Skip to content

Commit

Permalink
Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
I-am-PUID-0 committed Oct 28, 2024
1 parent 8ffad49 commit 3e511f4
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
FROM alpine:3.20 AS pgagent-builder
RUN apk add --no-cache --virtual .build-deps \
cmake boost-dev build-base linux-headers postgresql-dev curl unzip && \
curl -L https://github.com/pgadmin-org/pgagent/archive/refs/heads/master.zip -o pgagent.zip && \
unzip pgagent.zip && \
sed -i 's/EXEC_PROGRAM/execute_process/g' pgagent-master/cmake/FindPG.cmake && \
sed -i 's/cmake_minimum_required(VERSION 3.3)/cmake_minimum_required(VERSION 3.16)/g' pgagent-master/CMakeLists.txt && \
cd pgagent-master && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr/local \
-DBoost_INCLUDE_DIR=/usr/include \
-DBoost_LIBRARY_DIRS=/usr/lib \
-DPostgreSQL_CONFIG_EXECUTABLE=$(which pg_config) .. && \
make && make install && \
cmake boost-dev build-base linux-headers postgresql-dev curl unzip jq && \
RELEASE_TAG=$(curl -s https://api.github.com/repos/pgadmin-org/pgagent/releases/latest | jq -r .tag_name) && \
curl -L https://github.com/pgadmin-org/pgagent/archive/refs/tags/$RELEASE_TAG.zip -o pgagent-latest.zip && \
unzip pgagent-latest.zip && \
mv pgagent-*/ pgagent && \
cd pgagent && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. && make && make install && \
mkdir -p /usr/share/postgresql16/extension && \
cp ../sql/pgagent*.sql /usr/share/postgresql16/extension/ && \
cp ../pgagent.control.in /usr/share/postgresql16/extension/pgagent.control && \
PGAGENT_VERSION=$(ls /usr/share/postgresql16/extension/pgagent--*.sql | sed -E 's/.*pgagent--([0-9]+\.[0-9]+).*/\1/' | sort -V | tail -n 1) && \
sed -i "s/\${MAJOR_VERSION}.\${MINOR_VERSION}/$PGAGENT_VERSION/" /usr/share/postgresql16/extension/pgagent.control && \
cd ../.. && rm -rf pgagent-master pgagent.zip && \
cd ../.. && rm -rf pgagent pgagent-latest.zip && \
apk del .build-deps


Expand Down

0 comments on commit 3e511f4

Please sign in to comment.