Skip to content

Commit 4129d38

Browse files
authored
Fix pkg_resources deprecation warning by migrating Docker base image to python:3-alpine from alpine:latest. #9155
1 parent c03b550 commit 4129d38

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

Dockerfile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,12 @@ RUN export CPPFLAGS="-DPNG_ARM_NEON_OPT=0" && \
6868
# Next, create the base environment for Python
6969
#########################################################################
7070

71-
FROM alpine:latest AS env-builder
71+
FROM python:3-alpine AS env-builder
7272

7373
# Install dependencies
7474
COPY requirements.txt /
7575
RUN apk add --no-cache \
76-
make \
77-
python3 \
78-
py3-pip && \
76+
make && \
7977
apk add --no-cache --virtual build-deps \
8078
build-base \
8179
openssl-dev \
@@ -86,8 +84,7 @@ RUN apk add --no-cache \
8684
cargo \
8785
zlib-dev \
8886
libjpeg-turbo-dev \
89-
libpng-dev \
90-
python3-dev && \
87+
libpng-dev && \
9188
python3 -m venv --system-site-packages --without-pip /venv && \
9289
/venv/bin/python3 -m pip install --no-cache-dir -r requirements.txt && \
9390
apk del --no-cache build-deps
@@ -164,20 +161,18 @@ COPY --from=pg18-builder /usr/local/bin/psql /usr/local/pgsql/pgsql-18/
164161
# Assemble everything into the final container.
165162
#########################################################################
166163

167-
FROM alpine:latest
164+
FROM python:3-alpine
168165

169166
# Copy in the Python packages
170167
COPY --from=env-builder /venv /venv
171168

172169
# Copy in the tools
173170
COPY --from=tool-builder /usr/local/pgsql /usr/local/
174171
COPY --from=pg18-builder /usr/local/lib/libpq.so.5.18 /usr/lib/
175-
COPY --from=pg18-builder /usr/lib/libzstd.so.1.5.7 /usr/lib/
176172
COPY --from=pg18-builder /usr/lib/liblz4.so.1.10.0 /usr/lib/
177173

178174
RUN ln -s libpq.so.5.18 /usr/lib/libpq.so.5 && \
179175
ln -s libpq.so.5.18 /usr/lib/libpq.so && \
180-
ln -s libzstd.so.1.5.7 /usr/lib/libzstd.so.1 && \
181176
ln -s liblz4.so.1.10.0 /usr/lib/liblz4.so.1
182177

183178
WORKDIR /pgadmin4
@@ -195,9 +190,7 @@ COPY LICENSE /pgadmin4/LICENSE
195190

196191
# Install runtime dependencies and configure everything in one RUN step
197192
RUN apk add --no-cache \
198-
python3 \
199193
bash \
200-
py3-pip \
201194
postfix \
202195
krb5-libs \
203196
libjpeg-turbo \
@@ -217,7 +210,7 @@ RUN apk add --no-cache \
217210
chown pgadmin:root /pgadmin4/config_distro.py && \
218211
chmod g=u /pgadmin4/config_distro.py && \
219212
chmod g=u /etc/passwd && \
220-
setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/python3.12 && \
213+
setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/python3.[0-9][0-9] && \
221214
echo "pgadmin ALL = NOPASSWD: /usr/sbin/postfix start" > /etc/sudoers.d/postfix && \
222215
echo "pgadminr ALL = NOPASSWD: /usr/sbin/postfix start" >> /etc/sudoers.d/postfix
223216

0 commit comments

Comments
 (0)