Hello,
We will use podman containers in the future to test the update of our
application server from version 'X' to version 'Y', multiple times and
using
always the podman container running version 'X' to test the update
again, i.e. on boot (run) the container has always again the version
'X' to be updated. Part of this is a complete PostgreSQL 15.1 cluster
with the database to be used by the application servers (a complete
Library Management System). The challenging part was the cluster of
around 6 GByte, to not have to load or build it after the launch of the
container. I came up with the idea to create a tar archive of the
complete cluster below /data/postgresql151/ saved this outside and pull
it in while building the podman container. The Dockerfile has for this:
...
# we used a ready to run PostgreSQL cluster from now
#
RUN cp /usr/local/sisis-pap/pgsql-15.1/etc/linux /etc/init.d/postgres
RUN mkdir /data
COPY cluster.tgz /data
RUN tar xPzf /data/cluster.tgz
# Start PostgreSQL server and SSH daemon on container start
#
COPY initSunRise.sh /usr/local/bin/initSunRise.sh
RUN chmod 0755 /usr/local/bin/initSunRise.sh
RUN echo "/etc/init.d/postgres start" >>
/usr/local/bin/start.sh
RUN echo "/usr/local/bin/initSunRise.sh" >>
/usr/local/bin/start.sh
RUN echo "/usr/sbin/sshd -D" >>
/usr/local/bin/start.sh
RUN chmod 0755 /usr/local/bin/start.sh
...
EXPOSE 22 8076 3045
ENTRYPOINT /usr/local/bin/start.sh
STOPSIGNAL SIGQUIT
If we have to change something in the cluster, for example content of
tables, we have to export a fresh copy to the file cluster.tgz again and
build the container again.
This works fine and a start of the container with
podman run -d -p 2022:22 -p .... sles15-sp6-v73
make the system available for SSH in a few seconds with the PostgreSQL server
and all app servers launched and ready to use for the update to 'Y'.
Comments or hints for improvement?
matthias
--
Matthias Apitz, ✉ guru(a)unixarea.de,
http://www.unixarea.de/ +49-176-38902045
Public GnuPG key:
http://www.unixarea.de/key.pub
Annalena Baerbock: "We are fighting a war against Russia ..." (25.1.2023)
I, Matthias, I am not at war with Russia.
Я не воюю с Россией.
Ich bin nicht im Krieg mit Russland.