Skip to content

Commit c3f19d7

Browse files
committed
fixes related to postgres version, change way tomcat image is built
1 parent c12372b commit c3f19d7

File tree

1 file changed

+61
-34
lines changed

1 file changed

+61
-34
lines changed

Dockerfile-debian

Lines changed: 61 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@
66
# This image contains the artifacts used by the later stages.
77
# The image is NOT pushed, just the cached layers used.
88

9+
# also change the base image in the other sections
910
FROM debian:trixie as build
1011
LABEL maintainer="Tim Dudgeon<[email protected]>"
1112

1213
ARG GIT_REPO=https://github.com/rdkit/rdkit.git
1314
ARG GIT_BRANCH=master
1415
ARG GIT_TAG
15-
ARG POSTGRES_VERSION=17
16+
# also change the POSTGRES_VER variable in the cartridge image section
17+
ARG POSTGRES_VER=17
18+
# also change the BOOST_VER variable in the other sections
1619
ARG BOOST_VER=1.83
17-
ARG JAVA_VERSION=17
20+
# also change the JAVA_VER variable in the java image section
21+
ARG JAVA_VER=17
1822

1923
RUN apt-get update &&\
2024
apt-get install -y --no-install-recommends \
@@ -38,10 +42,10 @@ RUN apt-get update &&\
3842
libeigen3-dev\
3943
git\
4044
wget\
41-
openjdk-$JAVA_VERSION-jdk\
42-
postgresql-$POSTGRES_VERSION\
43-
postgresql-server-dev-$POSTGRES_VERSION\
44-
postgresql-plpython3-$POSTGRES_VERSION\
45+
openjdk-$JAVA_VER-jdk\
46+
postgresql-$POSTGRES_VER\
47+
postgresql-server-dev-$POSTGRES_VER\
48+
postgresql-plpython3-$POSTGRES_VER\
4549
zip\
4650
unzip\
4751
libfreetype6-dev &&\
@@ -55,8 +59,8 @@ RUN git clone -b $GIT_BRANCH --single-branch $GIT_REPO &&\
5559
ENV RDBASE=/rdkit
5660
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RDBASE/lib:$RDBASE/Code/JavaWrappers/gmwrapper:/usr/lib/x86_64-linux-gnu:/usr/lib/aarch64-linux-gnu/
5761
ENV PYTHONPATH=$PYTHONPATH:$RDBASE
58-
RUN ln -s $(ls -d /usr/lib/jvm/java-$JAVA_VERSION-openjdk-*) /usr/lib/jvm/java-$JAVA_VERSION-openjdk
59-
ENV JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk
62+
RUN ln -s $(ls -d /usr/lib/jvm/java-$JAVA_VER-openjdk-*) /usr/lib/jvm/java-$JAVA_VER-openjdk
63+
ENV JAVA_HOME=/usr/lib/jvm/java-$JAVA_VER-openjdk
6064
ENV CLASSPATH=$RDBASE/Code/JavaWrappers/gmwrapper/org.RDKit.jar
6165

6266
RUN mkdir $RDBASE/build
@@ -70,8 +74,8 @@ RUN cmake -Wno-dev\
7074
-DRDK_BUILD_PYTHON_WRAPPERS=ON\
7175
-DRDK_BUILD_SWIG_WRAPPERS=ON\
7276
-DRDK_BUILD_PGSQL=ON\
73-
-DPostgreSQL_ROOT=/usr/lib/postgresql/$POSTGRES_VERSION\
74-
-DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/postgresql/$POSTGRES_VERSION/server\
77+
-DPostgreSQL_ROOT=/usr/lib/postgresql/$POSTGRES_VER\
78+
-DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/postgresql/$POSTGRES_VER/server\
7579
-DCMAKE_INSTALL_PREFIX=/usr\
7680
-DCPACK_PACKAGE_RELOCATABLE=OFF\
7781
..
@@ -87,10 +91,10 @@ WORKDIR $RDBASE
8791

8892
################################# Python image ######################################
8993

90-
FROM debian:bookworm AS python
94+
FROM debian:trixie AS python
9195
LABEL maintainer="Tim Dudgeon<[email protected]>"
9296

93-
ARG BOOST_VER=1.81.0
97+
ARG BOOST_VER=1.83
9498

9599
RUN apt-get update &&\
96100
apt-get upgrade -y &&\
@@ -140,16 +144,16 @@ USER 1000
140144
# Dockerfile for Java based RDKit implementation
141145
# Based on Debian.
142146

143-
FROM debian:bookworm AS java
147+
FROM debian:trixie AS java
144148
LABEL maintainer="Tim Dudgeon<[email protected]>"
145149

146-
ARG BOOST_VER=1.81
147-
ARG JAVA_VERSION=17
150+
ARG BOOST_VER=1.83
151+
ARG JAVA_VER=17
148152

149153
RUN apt-get update &&\
150154
apt-get upgrade -y &&\
151155
apt-get install -y --no-install-recommends\
152-
openjdk-$JAVA_VERSION-jre-headless\
156+
openjdk-$JAVA_VER-jre-headless\
153157
libboost$BOOST_VER\
154158
libboost$BOOST_VER-dev\
155159
libboost-system$BOOST_VER\
@@ -169,8 +173,8 @@ RUN dpkg -i /tmp/*.deb && rm -f /tmp/*.deb
169173

170174
WORKDIR /
171175

172-
RUN ln -s $(ls -d /usr/lib/jvm/java-$JAVA_VERSION-openjdk-*) /usr/lib/jvm/java-$JAVA_VERSION-openjdk
173-
ENV JAVA_HOME=/usr/lib/jvm/java-$JAVA_VERSION-openjdk
176+
RUN ln -s $(ls -d /usr/lib/jvm/java-$JAVA_VER-openjdk-*) /usr/lib/jvm/java-$JAVA_VER-openjdk
177+
ENV JAVA_HOME=/usr/lib/jvm/java-$JAVA_VER-openjdk
174178
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/rdkit/gmwrapper
175179
ENV CLASSPATH=/rdkit/gmwrapper/org.RDKit.jar
176180
ENV RDBASE=/usr/share/RDKit
@@ -182,16 +186,23 @@ USER 1000
182186

183187
################################# Tomcat image ######################################
184188

185-
FROM informaticsmatters/tomcat:10.1-jre17 AS tomcat
189+
FROM debian:trixie AS tomcat
186190
LABEL maintainer="Tim Dudgeon<[email protected]>"
187191

188-
ARG BOOST_VER=1.81
192+
ARG BOOST_VER=1.83
193+
194+
ENV TOMCAT_MAJOR 10
195+
ENV TOMCAT_VERSION 10.1.33
196+
ENV ARCHIVE apache-tomcat-$TOMCAT_VERSION.tar.gz
197+
ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64
189198

190199
USER root
191200

192201
RUN apt-get update &&\
193-
apt-get upgrade -y &&\
202+
apt-get upgrade -y &&\
194203
apt-get install -y --no-install-recommends\
204+
openjdk-17-jre-headless\
205+
curl\
195206
unzip\
196207
libboost-system$BOOST_VER\
197208
libboost-thread$BOOST_VER\
@@ -208,6 +219,23 @@ COPY --from=build /rdkit/Code/JavaWrappers/gmwrapper/org.RDKit.jar /rdkit/Code/J
208219
COPY --from=build /rdkit/build/RDKit-*-Linux-Runtime.deb /tmp/
209220
RUN dpkg -i /tmp/*.deb && rm -f /tmp/*.deb
210221

222+
RUN useradd -u 501 -U -G 0 -m tomcat
223+
224+
WORKDIR /usr/local
225+
226+
RUN curl -s -o tomcat.tar.gz -L https://www.apache.org/dist/tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/$ARCHIVE &&\
227+
tar xfz tomcat.tar.gz &&\
228+
rm tomcat.tar.gz &&\
229+
mv apache-tomcat-$TOMCAT_VERSION tomcat &&\
230+
rm tomcat/bin/*.bat &&\
231+
rm -rf tomcat/webapps/* &&\
232+
chown -R 501:0 tomcat &&\
233+
chmod -R g+r tomcat &&\
234+
chmod g+w tomcat tomcat/logs tomcat/webapps tomcat/temp tomcat/work tomcat/conf tomcat/bin tomcat/lib
235+
236+
WORKDIR /usr/local/tomcat
237+
ENV CATALINA_HOME /usr/local/tomcat
238+
EXPOSE 8080
211239
USER 501
212240

213241
WORKDIR $CATALINA_HOME
@@ -217,6 +245,7 @@ ENV RDBASE=/usr/share/RDKit/
217245

218246
RUN echo "CLASSPATH=/rdkit/gmwrapper/org.RDKit.jar\n" > /usr/local/tomcat/bin/setenv.sh
219247

248+
CMD ["$CATALINA_HOME/bin/catalina.sh", "run"]
220249

221250
################################# Cartridge image ###################################
222251
# Dockerfile for RDKit cartridge based on Debian.
@@ -225,14 +254,14 @@ RUN echo "CLASSPATH=/rdkit/gmwrapper/org.RDKit.jar\n" > /usr/local/tomcat/bin/se
225254
# build the deb packages so we need to install the packages using apt to have tight control over this.
226255
#
227256

228-
FROM debian:bookworm AS cartridge
257+
FROM debian:trixie AS cartridge
229258
LABEL maintainer="Tim Dudgeon<[email protected]>"
230259

231-
ENV PG_MAJOR=15
232-
ENV BOOST_VER=1.81.0
260+
ENV POSTGRES_VER=17
261+
ENV BOOST_VER=1.83
233262

234263
RUN apt-get update &&\
235-
apt-get upgrade -y &&\
264+
apt-get upgrade -y &&\
236265
apt-get install -y --no-install-recommends\
237266
python3\
238267
python3-numpy\
@@ -246,10 +275,10 @@ RUN apt-get update &&\
246275
libboost-date-time$BOOST_VER\
247276
libboost-atomic$BOOST_VER\
248277
libboost-iostreams$BOOST_VER\
249-
libfreetype6\
250-
postgresql-$PG_MAJOR\
251-
postgresql-client-$PG_MAJOR\
252-
postgresql-plpython3-$PG_MAJOR\
278+
libfreetype6\
279+
postgresql-$POSTGRES_VER\
280+
postgresql-client-$POSTGRES_VER\
281+
postgresql-plpython3-$POSTGRES_VER\
253282
pgtop\
254283
gosu\
255284
wget\
@@ -266,15 +295,15 @@ RUN dpkg -i /tmp/RDKit-*.deb && rm -f /tmp/*.deb
266295
WORKDIR /
267296

268297
# make the sample config easier to munge (and "correct by default")
269-
RUN mv -v "/usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample" /usr/share/postgresql/ \
270-
&& ln -sv ../postgresql.conf.sample "/usr/share/postgresql/$PG_MAJOR/" \
298+
RUN mv -v "/usr/share/postgresql/$POSTGRES_VER/postgresql.conf.sample" /usr/share/postgresql/ \
299+
&& ln -sv ../postgresql.conf.sample "/usr/share/postgresql/$POSTGRES_VER/" \
271300
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
272301

273302
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
274303

275304
ENV RDBASE=/usr/share/RDKit
276305
ENV PGDATA /var/lib/postgresql/data
277-
ENV PATH $PATH:/usr/lib/postgresql/$PG_MAJOR/bin
306+
ENV PATH $PATH:/usr/lib/postgresql/$POSTGRES_VER/bin
278307
# this 777 will be replaced by 700 at runtime (allows semi-arbitrary "--user" values)
279308
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA"
280309
VOLUME /var/lib/postgresql/data
@@ -287,5 +316,3 @@ ENTRYPOINT ["docker-entrypoint.sh"]
287316

288317
EXPOSE 5432
289318
CMD ["postgres"]
290-
291-

0 commit comments

Comments
 (0)