Closed benjaminh closed 2 years ago
Hi Benjamim.
I've got this issue too, and this is because of the old embeded PostgreSQL JDBC driver (9.4.xx). I used the 3.10.2 version and got the same issues, too.
PostgreSQL 13+ now has default password encription set to SHA256. You have to change on postgresql.conf, putting back to MD5 or change the JDBC client. Look this thread
I had to change the JDBC driver version and, then, compiled geonetwork from sources and made my own image.
And so it works.
FROM maven:3.8-openjdk-8 AS BUILDER
ARG GEONETWORK_GIT_URL=https://github.com/geonetwork/core-geonetwork.git
ARG GEONETWORK_VERSION=3.10.x
ARG POSTGRESQL_JDBC_DRIVER_VERSION=42.2.18
ENV MAVEN_OPTS -Xmx512M -XX:MaxPermSize=256M
# VOLUME ["/root/.m2"]
WORKDIR /tmp
RUN git clone --recursive ${GEONETWORK_GIT_URL} geonetwork
WORKDIR /tmp/geonetwork
# Trocar o driver do PostgreSQL, pois o atual não suporta as versões 13+ antes de compilar
RUN set -xe && \
git checkout ${GEONETWORK_VERSION} && \
sed -i 's/<pg\.version>[^<]*</<pg.version>${POSTGRESQL_JDBC_DRIVER_VERSION}</g' pom.xml && \
mvn clean install -DskipTests
FROM tomcat:8.5-jre8-openjdk-slim-bullseye AS RELEASE
RUN apt-get -y update && \
apt-get -y install locales && \
sed -i '/pt_BR.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen && \
apt-get -y autoremove --purge && \
rm -rf /var/lib/apt/lists/*
COPY --from=BUILDER /tmp/geonetwork/web/target/geonetwork/ ${CATALINA_HOME}/webapps/geonetwork/
I try to create a docker composition so that geonetwork and geoserver connect to the same Postgres/PostGIS database. So I use
geonetwork:postgres
image as suggested in the doc to connect to a postgres docker container.When starting the containers, I get several SQLException errors, and all of them end with:
Here is my
docker-compose.yml
v3.1 example file (without the geoserver container) so that you can reproduce the problem :Notes:
.env
file, but you can specify your own values.kartoza/postgis:13.0
because it is the one suggested by the geoserver docker documentation.By the way, if I try to set a database service with a different image (like
postgis/postgis
), everything works fine. Yet, both images set up a postgres v13.0 database with a postgis v3.0. I guess this is a matter of postgres configuration, with some differences between the images, but I don't know which ones.Could you elaborate on what postgres/postgis versions are compatible with the geonetwork docker images, and maybe specify this in the documentation ?