fix: bump alpine 3.24, dynamic python paths in patch.py, tini via apk
PR Checks / hadolint (pull_request) Successful in 19s
PR Checks / build-test (pull_request) Successful in 28s

- 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:
Sagent
2026-07-16 16:27:13 +00:00
parent bbdfda3fa1
commit cd51949b47
2 changed files with 83 additions and 19 deletions
+8 -14
View File
@@ -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" ]