fix: bump alpine 3.24, dynamic python paths in patch.py, tini via apk
- Alpine 3.23 → 3.24 (ships Python 3.14, not 3.12) - patch.py: use glob + sys.version_info instead of hardcoded python3.12 paths - Move SSL SECLEVEL=1 sed from Dockerfile into patch.py - Tini: replace commented-out manual binary download with apk add tini (ENTRYPOINT ["/sbin/tini", "--"] as PID 1 for proper signal handling) - Remove dead TINI_VERSION env and commented-out lines
This commit is contained in:
+8
-14
@@ -1,27 +1,21 @@
|
||||
FROM alpine:3.23
|
||||
FROM alpine:3.24
|
||||
LABEL maintainer="Cabillot Julien <dockerimages@cabillot.eu>"
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
COPY patch.py /tmp/patch.py
|
||||
|
||||
# hadolint ignore=DL3018
|
||||
RUN apk add --no-cache offlineimap openssl && \
|
||||
RUN apk add --no-cache offlineimap openssl tini && \
|
||||
adduser -D offlineimap && \
|
||||
# Force SECLEVEL=1 in imaplib2 to allow connecting to servers with weak DH keys (DH_KEY_TOO_SMALL)
|
||||
# This is required because OpenSSL 3.x in Alpine 3.23 defaults to SECLEVEL=2
|
||||
sed -i 's/ctx = ssl.SSLContext(ssl_version)/ctx = ssl.SSLContext(ssl_version)\n ctx.set_ciphers("DEFAULT:@SECLEVEL=1")/' /usr/lib/python3.*/site-packages/imaplib2/imaplib2.py && \
|
||||
# Patch offlineimap email generator bug for defective messages
|
||||
# Apply post-install patches:
|
||||
# - UnicodeEncodeError fallback for defective messages (Maildir + IMAP)
|
||||
# - SSL SECLEVEL=1 in imaplib2 to allow connecting to servers with weak DH keys
|
||||
# (OpenSSL 3.x defaults to SECLEVEL=2)
|
||||
python3 /tmp/patch.py && rm /tmp/patch.py
|
||||
|
||||
COPY --chown=offlineimap offlineimaprc.*.tmpl /home/offlineimap/
|
||||
|
||||
# Add Tini
|
||||
ENV "TINI_VERSION" "v0.16.1"
|
||||
#ADD "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" "/tini"
|
||||
#RUN chmod +x "/tini"
|
||||
#ENTRYPOINT ["/tini", "--"]
|
||||
|
||||
USER "offlineimap"
|
||||
|
||||
#ENTRYPOINT [ "/entrypoint.sh" ]
|
||||
CMD [ "/entrypoint.sh" ]
|
||||
ENTRYPOINT ["/sbin/tini", "--"]
|
||||
CMD [ "/entrypoint.sh" ]
|
||||
Reference in New Issue
Block a user