Repository: pgmoneta/pgmoneta
Pull request #540: [#533] Feat : Add docker support to pgmoneta
Author: login: Arshdeep54
Labels: name: feature
description: New feature
Created: 2025-03-27T20:34:45Z | Merged: 2025-03-28T20:41:29Z



Diff:
diff --git a/AUTHORS b/AUTHORS
index be29c9063..619a4f29a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -28,4 +28,5 @@ Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
 Ahmed Ashour <a8087027@gmail.com>
 Sangkeun J.C. Kim <jchrys@me.com>
 Tejas Tyagi <tejastyagi.tt@gmail.com>
-Aryan Arora <aryanarora.w1@gmail.com>
\ No newline at end of file
+Aryan Arora <aryanarora.w1@gmail.com>
+Arshdeep Singh <balarsh535@gmail.com>
\ No newline at end of file
diff --git a/contrib/docker/Dockerfile.alpine b/contrib/docker/Dockerfile.alpine
new file mode 100644
index 000000000..3a370cff8
--- /dev/null
+++ b/contrib/docker/Dockerfile.alpine
@@ -0,0 +1,110 @@
+#
+# Copyright (C) 2025 The pgmoneta community
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list
+# of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this
+# list of conditions and the following disclaimer in the documentation and/or other
+# materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its contributors may
+# be used to endorse or promote products derived from this software without specific
+# prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+FROM alpine:latest AS builder
+
+RUN apk add --no-cache \
+    git \
+    gcc \
+    cmake \
+    make \
+    postgresql-dev \
+    zlib \
+    zlib-dev \
+    zstd \
+    zstd-dev \
+    lz4 \
+    lz4-dev \
+    bzip2 \
+    bzip2-dev \
+    libpq \
+    libpq-dev \
+    musl-dev \
+    libev-dev \
+    py-docutils \
+    pandoc \
+    texlive texmf-dist \
+    doxygen graphviz \
+    libatomic \
+    yaml-dev \
+    libarchive \
+    libarchive-dev \
+    libcurl \
+    curl-dev \
+    libssh \
+    libssh-dev \
+WORKDIR /src
+
+COPY . .
+
+RUN rm -rf build && mkdir build
+
+RUN cd build && \
+    cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ .. && \
+    make -j$(nproc) && \
+    make install
+
+FROM alpine:latest
+
+RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \
+    echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
+    apk update && \
+    apk add --no-cache \
+    postgresql17 \
+    postgresql17-client \
+    bash \
+    ca-certificates \
+    libev \
+    yaml \
+    bzip2 \
+    bzip2-dev \
+    libpq \
+    libatomic \
+    zstd \
+    lz4-libs
+
+RUN adduser -D -s /bin/sh pgmoneta
+
+WORKDIR /pgmoneta
+
+COPY --from=builder /usr/local/bin/pgmoneta /usr/local/bin/pgmoneta-cli /usr/local/bin/pgmoneta-admin /usr/local/bin/
+COPY --from=builder /usr/local/lib/libpgmoneta.so* /usr/local/lib/
+
+COPY contrib/docker/pgmoneta.conf /etc/pgmoneta/pgmoneta.conf
+
+RUN chown -R pgmoneta:pgmoneta /pgmoneta /etc/pgmoneta
+RUN chmod +x /usr/local/bin/pgmoneta /usr/local/bin/pgmoneta-cli /usr/local/bin/pgmoneta-admin
+
+EXPOSE 5002
+
+USER pgmoneta
+
+RUN echo "pgmoneta" | /usr/local/bin/pgmoneta-admin master-key && \
+    printf "pgmoneta\npgmoneta\npgmoneta\n" | /usr/local/bin/pgmoneta-admin -f /etc/pgmoneta/pgmoneta_users.conf user add
+
+
+CMD ["/usr/local/bin/pgmoneta", "-c", "/etc/pgmoneta/pgmoneta.conf", "-u","/etc/pgmoneta/pgmoneta_users.conf"]
diff --git a/contrib/docker/Dockerfile.rocky9 b/contrib/docker/Dockerfile.rocky9
new file mode 100644
index 000000000..c0ace45ab
--- /dev/null
+++ b/contrib/docker/Dockerfile.rocky9
@@ -0,0 +1,109 @@
+#
+# Copyright (C) 2025 The pgmoneta community
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this list
+# of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice, this
+# list of conditions and the following disclaimer in the documentation and/or other
+# materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its contributors may
+# be used to endorse or promote products derived from this software without specific
+# prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+FROM rockylinux:9 AS builder
+
+RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
+    dnf -y upgrade && \
+    dnf install -y dnf-plugins-core && \
+    dnf config-manager --set-enabled crb && \
+    dnf makecache && \
+    dnf install -y \
+        git \
+        gcc \
+        cmake \
+        make \
+        postgresql-devel \
+        zlib \
+        zlib-devel \
+        zstd \
+        libzstd-devel \
+        lz4 \
+        lz4-devel \
+        bzip2 \
+        bzip2-devel \
+        libpq \
+        libpq-devel \
+        libev-devel \
+        python3-docutils \
+        pandoc \
+        texlive \
+        doxygen \
+        graphviz \
+        openssl-devel \
+        libatomic \
+        libyaml-devel \
+        libarchive \
+        libarchive-devel \
+        libssh-devel \
+        libcurl-devel \
+        yaml-cpp-devel && \
+    dnf clean all
+
+WORKDIR /src
+
+COPY . .
+
+RUN rm -rf build && mkdir build
+
+RUN cd build && \
+    cmake .. -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_RPATH=/usr/local/lib -DCMAKE_C_FLAGS="-Wno-format-truncation" && \
+    make && \
+    make install
+
+FROM rockylinux:9
+
+RUN dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm && \
+    dnf -y update && \
+    dnf install -y postgresql17-server \
+        postgresql17-contrib \
+        libpq5 \
+        libev \
+        libatomic \
+        libssh && \
+    dnf clean all
+
+RUN useradd --create-home --shell /bin/bash pgmoneta
+
+WORKDIR /pgmoneta
+
+COPY --from=builder /usr/local/bin/pgmoneta /usr/local/bin/pgmoneta-cli /usr/local/bin/pgmoneta-admin /usr/local/bin/
+COPY --from=builder /usr/local/lib/libpgmoneta.so* /usr/local/lib/
+
+COPY contrib/docker/pgmoneta.conf /etc/pgmoneta/pgmoneta.conf
+
+RUN chown -R pgmoneta:pgmoneta /pgmoneta /etc/pgmoneta
+RUN chmod +x /usr/local/bin/pgmoneta /usr/local/bin/pgmoneta-cli /usr/local/bin/pgmoneta-admin
+
+EXPOSE 5002
+
+USER pgmoneta
+
+RUN echo "pgmoneta" | /usr/local/bin/pgmoneta-admin master-key
+RUN /usr/local/bin/pgmoneta-admin -f /etc/pgmoneta/pgmoneta_users.conf -U repl -P secretpassword user add
+
+CMD ["/usr/local/bin/pgmoneta", "-c", "/etc/pgmoneta/pgmoneta.conf", "-u", "/etc/pgmoneta/pgmoneta_users.conf"]
\ No newline at end of file
diff --git a/contrib/docker/pgmoneta.conf b/contrib/docker/pgmoneta.conf
new file mode 100644
index 000000000..b4f75c237
--- /dev/null
+++ b/contrib/docker/pgmoneta.conf
@@ -0,0 +1,21 @@
+[pgmoneta]
+host = *
+metrics = 5001
+
+base_dir = /home/pgmoneta/backup
+
+compression = zstd
+
+retention = 7
+
+log_type = file
+log_level = info
+log_path = /tmp/pgmoneta.log
+
+unix_socket_dir = /tmp/
+
+[primary]
+host = 127.0.0.1
+port = 5432
+user = repl
+wal_slot = repl
\ No newline at end of file
diff --git a/doc/GETTING_STARTED.md b/doc/GETTING_STARTED.md
index a7d54acbd..c1bd666c6 100644
--- a/doc/GETTING_STARTED.md
+++ b/doc/GETTING_STARTED.md
@@ -285,6 +285,7 @@ There are a few short tutorials available to help you better understand and conf
 - [Annotate](https://github.com/pgmoneta/pgmoneta/blob/main/doc/tutorial/14_annotate.md)
 - [Extra files](https://github.com/pgmoneta/pgmoneta/blob/main/doc/tutorial/15_extra.md)
 - [Incremental backup and restore](https://github.com/pgmoneta/pgmoneta/blob/main/doc/tutorial/16_incremental_backup_restore.md)
+- [Dockerize pgmoneta](https://github.com/pgmoneta/pgmoneta/blob/main/doc/tutorial/17_docker.md)
 
 ## Closing
 
diff --git a/doc/manual/97-acknowledgement.md b/doc/manual/97-acknowledgement.md
index 4d91b67df..a6d4a0b7e 100644
--- a/doc/manual/97-acknowledgement.md
+++ b/doc/manual/97-acknowledgement.md
@@ -36,6 +36,7 @@ Ahmed Ashour <a8087027@gmail.com>
 Sangkeun J.C. Kim <jchrys@me.com>
 Tejas Tyagi <tejastyagi.tt@gmail.com>
 Aryan Arora <aryanarora.w1@gmail.com>
+Arshdeep Singh <balarsh535@gmail.com>
 ```
 
 ## Committers
diff --git a/doc/manual/99-references.md b/doc/manual/99-references.md
index dba873180..a64e84aed 100644
--- a/doc/manual/99-references.md
+++ b/doc/manual/99-references.md
@@ -64,6 +64,7 @@
   [t_annotate]: https://github.com/pgmoneta/pgmoneta/blob/main/doc/tutorial/14_annotate.md
   [t_extra]: https://github.com/pgmoneta/pgmoneta/blob/main/doc/tutorial/15_extra.md
   [t_incremental]: https://github.com/pgmoneta/pgmoneta/blob/main/doc/tutorial/16_incremental_backup_restore.md
+  [t_docker]: https://github.com/pgmoneta/pgmoneta/blob/main/doc/tutorial/17_docker.md
 <!-- doc/etc -->
   [sample]: https://github.com/pgmoneta/pgmoneta/blob/main/doc/etc/pgmoneta.conf
 
diff --git a/doc/manual/advanced/12-docker.md b/doc/manual/advanced/12-docker.md
new file mode 100644
index 000000000..d36207b41
--- /dev/null
+++ b/doc/manual/advanced/12-docker.md
@@ -0,0 +1,154 @@
+# Running pgmoneta with Docker
+
+You can run `pgmoneta` using Docker instead of compiling it manually.
+
+## Prerequisites
+
+- **Docker** or **Podman** must be installed on the server where PostgreSQL is running.
+- Ensure PostgreSQL is configured to allow external connections.
+
+---
+## Update the configuration file if needed: 
+
+```conf
+[pgmoneta]
+host = *
+metrics = 5001
+
+base_dir = /home/pgmoneta/backup
+
+compression = zstd
+
+retention = 7
+
+log_type = file
+log_level = info
+log_path = /tmp/pgmoneta.log
+
+unix_socket_dir = /tmp/
+
+[primary]
+host = localhost
+port = 5432
+user = repl
+wal_slot = repl
+```
+
+## Step 1: Enable External PostgreSQL Access
+
+Modify the local PostgreSQL server's `postgresql.conf` file to allow connections from outside:
+```ini
+listen_addresses = '*'
+```
+
+Update `pg_hba.conf` to allow remote connections:
+```ini
+host    all    all    0.0.0.0/0    scram-sha-256
+```
+
+Then, restart PostgreSQL for the changes to take effect:
+```sh
+sudo systemctl restart postgresql
+```
+
+---
+
+## Step 2: Clone the Repository
+```sh
+git clone https://github.com/pgmoneta/pgmoneta.git
+cd pgmoneta
+```
+
+---
+
+## Step 3: Build the Docker Image
+
+There are two Dockerfiles available:
+1. **Alpine-based image**  
+   **Using Docker**
+   ```sh
+   docker build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.alpine .
+   ```
+   **Using Podman**
+   ```sh
+   podman build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.alpine .
+   ```
+
+2. **Rocky Linux 9-based image**  
+   **Using Docker**
+   ```sh
+   docker build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.rocky9 .
+   ```
+   **Using Podman**
+   ```sh
+   podman build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.rocky9 .
+   ```
+
+---
+
+## Step 4: Run pgmoneta as a Docker Container
+
+Once the image is built, run the container using:
+- **Using Docker**
+   ```sh
+   docker run -d --name pgmoneta --network host pgmoneta:latest
+   ```
+- **Using Podman**
+   ```sh
+   podman run -d --name pgmoneta --network host pgmoneta:latest
+   ```
+
+---
+
+## Step 5: Verify the Container
+
+Check if the container is running: 
+
+- **Using Docker**
+   ```sh
+   docker ps | grep pgmoneta
+   ```
+- **Using Podman**
+   ```sh
+   podman ps | grep pgmoneta
+   ```
+
+Check logs for any errors: 
+- **Using Docker**
+   ```sh
+   docker logs pgmoneta
+   ```
+- **Using Podman**
+   ```sh
+   podman logs pgmoneta
+   ```
+
+
+You can also inspect the exposed metrics at:
+```
+http://localhost:5001/metrics
+```
+
+You can stop the container using
+- **Using Docker**
+   ```sh
+   docker stop ppgmoneta 
+   ```
+- **Using Podman**
+   ```sh
+   podman stop ppgmoneta 
+   ```
+
+You can exec into the container and run the cli commands as 
+```sh
+docker exec -it pgmoneta /bin/bash
+#or using podman 
+podman exec -it pgmoneta /bin/bash
+
+cd /etc/pgmoneta
+/usr/local/bin/pgmoneta-cli -c pgmoneta.conf shutdown 
+```
+
+See [this](https://github.com/pgmoneta/pgmoneta/blob/main/doc/manual/user-10-cli.md) for more cli commands.
+
+You can access the three binaries at `/usr/local/bin`
diff --git a/doc/manual/advanced/97-acknowledgement.md b/doc/manual/advanced/97-acknowledgement.md
index 4d91b67df..a6d4a0b7e 100644
--- a/doc/manual/advanced/97-acknowledgement.md
+++ b/doc/manual/advanced/97-acknowledgement.md
@@ -36,6 +36,7 @@ Ahmed Ashour <a8087027@gmail.com>
 Sangkeun J.C. Kim <jchrys@me.com>
 Tejas Tyagi <tejastyagi.tt@gmail.com>
 Aryan Arora <aryanarora.w1@gmail.com>
+Arshdeep Singh <balarsh535@gmail.com>
 ```
 
 ## Committers
diff --git a/doc/manual/user-15-docker.md b/doc/manual/user-15-docker.md
new file mode 100644
index 000000000..721105f9f
--- /dev/null
+++ b/doc/manual/user-15-docker.md
@@ -0,0 +1,104 @@
+# Running pgmoneta with Docker
+
+You can run `pgmoneta` using Docker instead of compiling it manually.
+
+## Prerequisites
+
+- **Docker** or **Podman** must be installed on the server where PostgreSQL is running.
+- Ensure PostgreSQL is configured to allow external connections.
+
+---
+
+## Step 1: Enable External PostgreSQL Access
+
+Modify the local PostgreSQL server's `postgresql.conf` file to allow connections from outside:
+```ini
+listen_addresses = '*'
+```
+
+Update `pg_hba.conf` to allow remote connections:
+```ini
+host    all    all    0.0.0.0/0    scram-sha-256
+```
+
+Then, restart PostgreSQL for the changes to take effect:
+```sh
+sudo systemctl restart postgresql
+```
+
+---
+
+## Step 2: Clone the Repository
+```sh
+git clone https://github.com/pgmoneta/pgmoneta.git
+cd pgmoneta
+```
+
+---
+
+## Step 3: Build the Docker Image
+
+
+There are two Dockerfiles available:
+1. **Alpine-based image**  
+   **Using Docker**
+   ```sh
+   docker build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.alpine .
+   ```
+   **Using Podman**
+   ```sh
+   podman build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.alpine .
+   ```
+
+2. **Rocky Linux 9-based image**  
+   ```sh
+   docker build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.rocky9 .
+   ```
+   **Using Podman**
+   ```sh
+   podman build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.rocky9 .
+   ```
+
+---
+
+## Step 4: Run pgmoneta as a Docker Container
+
+Once the image is built, run the container using:
+- **Using Docker**
+   ```sh
+   docker run -d --name pgmoneta --network host pgmoneta:latest
+   ```
+- **Using Podman**
+   ```sh
+   podman run -d --name pgmoneta --network host pgmoneta:latest
+   ```
+
+---
+
+## Step 5: Verify the Container
+
+Check if the container is running: 
+
+- **Using Docker**
+   ```sh
+   docker ps | grep pgmoneta
+   ```
+- **Using Podman**
+   ```sh
+   podman ps | grep pgmoneta
+   ```
+
+Check logs for any errors: 
+- **Using Docker**
+   ```sh
+   docker logs pgmoneta
+   ```
+- **Using Podman**
+   ```sh
+   podman logs pgmoneta
+   ```
+
+You can also inspect the exposed server at:
+```
+http://localhost:5001/
+```
\ No newline at end of file
diff --git a/doc/tutorial/17_docker.md b/doc/tutorial/17_docker.md
new file mode 100644
index 000000000..95ec90f64
--- /dev/null
+++ b/doc/tutorial/17_docker.md
@@ -0,0 +1,104 @@
+# Running pgmoneta with Docker
+
+You can run `pgmoneta` using Docker instead of compiling it manually.
+
+## Prerequisites
+
+- **Docker** or **Podman** must be installed on the server where PostgreSQL is running.
+- Ensure PostgreSQL is configured to allow external connections.
+
+---
+
+## Step 1: Enable External PostgreSQL Access
+
+Modify the local PostgreSQL server's `postgresql.conf` file to allow connections from outside:
+```ini
+listen_addresses = '*'
+```
+
+Update `pg_hba.conf` to allow remote connections:
+```ini
+host    all    all    0.0.0.0/0    scram-sha-256
+```
+
+Then, restart PostgreSQL for the changes to take effect:
+```sh
+sudo systemctl restart postgresql
+```
+
+---
+
+## Step 2: Clone the Repository
+```sh
+git clone https://github.com/pgmoneta/pgmoneta.git
+cd pgmoneta
+```
+
+---
+
+## Step 3: Build the Docker Image`
+
+There are two Dockerfiles available:
+1. **Alpine-based image**  
+   **Using Docker**
+   ```sh
+   docker build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.alpine .
+   ```
+   **Using Podman**
+   ```sh
+   podman build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.alpine .
+   ```
+
+2. **Rocky Linux 9-based image**  
+   **Using Docker**
+   ```sh
+   docker build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.rocky9 .
+   ```
+   **Using Podman**
+   ```sh
+   podman build -t pgmoneta:latest -f ./contrib/docker/Dockerfile.rocky9 .
+   ```
+
+---
+
+## Step 4: Run pgmoneta as a Docker Container
+
+Once the image is built, run the container using:
+- **Using Docker**
+   ```sh
+   docker run -d --name pgmoneta --network host pgmoneta:latest
+   ```
+- **Using Podman**
+   ```sh
+   podman run -d --name pgmoneta --network host pgmoneta:latest
+   ```
+
+---
+
+## Step 5: Verify the Container
+
+Check if the container is running: 
+
+- **Using Docker**
+   ```sh
+   docker ps | grep pgmoneta
+   ```
+- **Using Podman**
+   ```sh
+   podman ps | grep pgmoneta
+   ```
+
+Check logs for any errors: 
+- **Using Docker**
+   ```sh
+   docker logs pgmoneta
+   ```
+- **Using Podman**
+   ```sh
+   podman logs pgmoneta
+   ```
+
+You can also inspect the exposed server at:
+```
+http://localhost:5001/
+```
\ No newline at end of file
diff --git a/pgmoneta.spec b/pgmoneta.spec
index 271be6d52..cf905094f 100644
--- a/pgmoneta.spec
+++ b/pgmoneta.spec
@@ -73,6 +73,7 @@ cmake -DCMAKE_BUILD_TYPE=Release ..
 %{__install} -m 644 %{_builddir}/%{name}-%{version}/doc/tutorial/14_annotate.md %{buildroot}%{_docdir}/%{name}/tutorial/14_annotate.md
 %{__install} -m 644 %{_builddir}/%{name}-%{version}/doc/tutorial/15_extra.md %{buildroot}%{_docdir}/%{name}/tutorial/15_extra.md
 %{__install} -m 644 %{_builddir}/%{name}-%{version}/doc/tutorial/16_incremental_backup_restore.md %{buildroot}%{_docdir}/%{name}/tutorial/16_incremental_backup_restore.md
+%{__install} -m 644 %{_builddir}/%{name}-%{version}/doc/tutorial/17_docker.md %{buildroot}%{_docdir}/%{name}/tutorial/17_docker.md
 
 %{__install} -m 644 %{_builddir}/%{name}-%{version}/build/doc/pgmoneta.1 %{buildroot}%{_mandir}/man1/pgmoneta.1
 %{__install} -m 644 %{_builddir}/%{name}-%{version}/build/doc/pgmoneta-admin.1 %{buildroot}%{_mandir}/man1/pgmoneta-admin.1
@@ -131,6 +132,7 @@ cd %{buildroot}%{_libdir}/
 %{_docdir}/%{name}/tutorial/14_annotate.md
 %{_docdir}/%{name}/tutorial/15_extra.md
 %{_docdir}/%{name}/tutorial/16_incremental_backup_restore.md
+%{_docdir}/%{name}/tutorial/17_docker.md
 %{_mandir}/man1/pgmoneta.1*
 %{_mandir}/man1/pgmoneta-admin.1*
 %{_mandir}/man1/pgmoneta-cli.1*


Reviews:
user: login: jesperpedersen
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-03-28T01:54:25Z
user: login: Arshdeep54
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-28T05:01:52Z

Review comments:
diff_hunk: @@ -0,0 +1,20 @@
+host = *
path: contrib/docker/pgmoneta.conf
user: login: jesperpedersen
body: Missing `[pgmoneta]`
created_at: 2025-03-28T01:53:07Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,20 @@
+host = *
path: contrib/docker/pgmoneta.conf
user: login: jesperpedersen
body: Does that work ? if so it is a bug...
created_at: 2025-03-28T01:53:24Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,20 @@
+host = *
path: contrib/docker/pgmoneta.conf
user: login: Arshdeep54
body: No, it was not working, so I kept the PR as a Draft. Now its working, Thanks 
created_at: 2025-03-28T05:01:52Z
author_association: CONTRIBUTOR

PR comments:
user: login: Arshdeep54
created_at: 2025-03-28T05:05:21Z
body: @jesperpedersen In the Alpine-based Dockerfile, the build requires `systemd` dependencies, unlike `pgexporter`, where they were optional. However, since Alpine does not have systemd, is there an alternative solution, or would it be better to use a different base image?
author_association: CONTRIBUTOR
user: login: jesperpedersen
created_at: 2025-03-28T07:54:42Z
body: @Arshdeep54 No, we should do the same as pgexporter and make systemd optional
author_association: MEMBER
user: login: jesperpedersen
created_at: 2025-03-28T08:00:27Z
body: @Arshdeep54 #545 
author_association: MEMBER
user: login: jesperpedersen
created_at: 2025-03-28T20:41:44Z
body: Merged.

Thanks for your contribution !
author_association: MEMBER