Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bookworm/debian 12, python 3.12, update python deps, fix buildx warnings #162

Merged
merged 8 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.11
ARG PYTHON_VERSION=3.12
ARG PLONE_VERSION
FROM plone/server-builder:${PLONE_VERSION} as builder
FROM plone/server-builder:${PLONE_VERSION} AS builder

ARG PLONE_VERSION

FROM plone/server-prod-config:${PLONE_VERSION}

ARG PYTHON_VERSION
ARG PLONE_VERSION

LABEL maintainer="Plone Community <[email protected]>" \
org.label-schema.name="plone-backend" \
org.label-schema.description="Plone backend image using Python $PYTHON_VERSION" \
org.label-schema.description="Plone $PLONE_VERSION backend image using Python $PYTHON_VERSION" \
org.label-schema.vendor="Plone Foundation"

# Use /app as the workdir
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile.acceptance
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.11
ARG PYTHON_VERSION=3.12
ARG PLONE_VERSION
FROM plone/server-builder:${PLONE_VERSION} as builder
FROM plone/server-builder:${PLONE_VERSION} AS builder

# https://github.com/pypa/pip/issues/12079
ENV _PIP_USE_IMPORTLIB_METADATA=0
ARG PLONE_VERSION

# Install robotframework support
RUN /app/bin/pip install plone.app.robotframework>=2.0.0

FROM plone/server-prod-config:${PLONE_VERSION}

ARG PYTHON_VERSION
ARG PLONE_VERSION

LABEL maintainer="Plone Community <[email protected]>" \
org.label-schema.name="server-acceptance" \
org.label-schema.description="Plone $PLONE_VERSION backend acceptance image using Python $PYTHON_VERSION" \
Expand All @@ -21,7 +23,7 @@ LABEL maintainer="Plone Community <[email protected]>" \
COPY --from=builder --chown=500:500 /app /app

# Set chameleon cache directory
ENV CHAMELEON_CACHE /app/var/cache
ENV CHAMELEON_CACHE=/app/var/cache
# Zope listens to all ip addresses
ENV ZSERVER_HOST=0.0.0.0
# Zope port to be 55001
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.builder
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION}-slim-bullseye
ARG PYTHON_VERSION=3.12
FROM python:${PYTHON_VERSION}-slim-bookworm

ARG PLONE_VERSION

ENV EXTRA_PACKAGES="relstorage==3.5.0 psycopg2==2.9.5 python-ldap==3.4.3 ZEO"
ENV EXTRA_PACKAGES="relstorage==4.1.1 psycopg2==2.9.10 python-ldap==3.4.4 ZEO"


LABEL maintainer="Plone Community <[email protected]>" \
Expand All @@ -28,7 +28,7 @@ RUN <<EOT
set -e
apt-get update
apt-get -y upgrade
buildDeps="build-essential busybox ca-certificates curl git gosu libbz2-dev libffi-dev libjpeg62-turbo-dev libmagic1 libldap2-dev libopenjp2-7-dev libpcre3-dev libpq-dev libsasl2-dev libssl-dev libtiff5-dev libxml2-dev libxslt1-dev wget zlib1g-dev"
buildDeps="build-essential busybox ca-certificates curl git gosu libbz2-dev libffi-dev libjpeg62-turbo-dev libmagic1 libsasl2-dev libldap2-dev libopenjp2-7-dev libpcre3-dev libpq-dev libssl-dev libtiff6 libtiff5-dev libxml2-dev libxslt1-dev wget zlib1g-dev"
apt-get install -y --no-install-recommends $buildDeps
busybox --install -s
python -m venv /app
Expand Down
11 changes: 8 additions & 3 deletions Dockerfile.classicui
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.11
ARG PYTHON_VERSION=3.12
ARG PLONE_VERSION
FROM plone/server-builder:${PLONE_VERSION} as builder
FROM plone/server-builder:${PLONE_VERSION} AS builder

# Remove Volto support from builder image
ARG PLONE_VERSION

# Remove Volto support from builder image, this is Classic UI
RUN /app/bin/pip uninstall -y plone.volto

FROM plone/server-prod-config:${PLONE_VERSION}

ARG PYTHON_VERSION
ARG PLONE_VERSION

LABEL maintainer="Plone Community <[email protected]>" \
org.label-schema.name="plone-classicui" \
org.label-schema.description="Plone $PLONE_VERSION Classic UI image using Python $PYTHON_VERSION" \
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.11
ARG PYTHON_VERSION=3.12
ARG PLONE_VERSION
FROM plone/server-builder:${PLONE_VERSION}

ARG PYTHON_VERSION
ARG PLONE_VERSION

LABEL maintainer="Plone Community <[email protected]>" \
org.label-schema.name="server-dev" \
Expand All @@ -19,15 +21,15 @@ RUN <<EOT
EOT

# Turns off buffering
ENV PYTHONUNBUFFERED 1
ENV PYTHONUNBUFFERED=1
# Keeps Python from generating .pyc files
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONDONTWRITEBYTECODE=1
# Enable Application server in debug mode
ENV DEBUG_MODE on
ENV DEBUG_MODE=on
# Disable compilation of po files into mo files
ENV zope_i18n_compile_mo_files=
# Set chameleon cache directory
ENV CHAMELEON_CACHE /app/var/cache
ENV CHAMELEON_CACHE=/app/var/cache
# Expose Zope Port
EXPOSE 8080

Expand Down
22 changes: 11 additions & 11 deletions Dockerfile.nightly
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION}-slim-bullseye as base
FROM base as builder
ARG PYTHON_VERSION=3.12
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
FROM base AS builder

ENV PIP_PARAMS=""
ENV PIP_VERSION=22.3.1
ENV EXTRA_PACKAGES="relstorage==3.5.0 psycopg2==2.9.5 python-ldap==3.4.3"
ENV PIP_VERSION=24.3.1
ENV EXTRA_PACKAGES="relstorage==4.1.1 psycopg2==2.9.10 python-ldap==3.4.4"

RUN mkdir /wheelhouse

RUN <<EOT
set -e
apt-get update
buildDeps="build-essential curl libbz2-dev libffi-dev libjpeg62-turbo-dev libldap2-dev libopenjp2-7-dev libpcre3-dev libpq-dev libsasl2-dev libssl-dev libtiff5-dev libxml2-dev libxslt1-dev wget unzip zlib1g-dev"
buildDeps="build-essential curl libbz2-dev libffi-dev libjpeg62-turbo-dev libsasl2-dev libldap2-dev libopenjp2-7-dev libpcre3-dev libpq-dev libssl-dev libtiff6 libtiff5-dev libxml2-dev libxslt1-dev wget unzip zlib1g-dev"
apt-get install -y --no-install-recommends $buildDeps
pip install -U "pip==${PIP_VERSION}"
pip install -U "zc.buildout>=3.0.0rc1" "wheel"
pip install -U "zc.buildout==4.0" "wheel==0.45.1"
rm -rf /var/lib/apt/lists/* /usr/share/doc
curl -L -o workspace.zip https://github.com/plone/buildout.coredev/archive/refs/heads/6.0.zip
curl -L -o workspace.zip https://github.com/plone/buildout.coredev/archive/refs/heads/6.1.zip
unzip workspace.zip
mv buildout.coredev-6.0 /workspace
mv buildout.coredev-6.1 /workspace
EOT

WORKDIR /workspace
Expand All @@ -36,7 +36,7 @@ EOT
FROM base

ENV PIP_PARAMS=""
ENV PIP_VERSION=22.0.4
ENV PIP_VERSION=24.3.1

LABEL maintainer="Plone Community <[email protected]>" \
org.label-schema.name="plone-backend" \
Expand All @@ -48,7 +48,7 @@ COPY --from=builder /wheelhouse /wheelhouse
RUN <<EOT
set -e
useradd --system -m -d /app -U -u 500 plone
runDeps="git libjpeg62 libopenjp2-7 libpq5 libtiff5 libxml2 libxslt1.1 lynx netcat poppler-utils rsync wv busybox libmagic1 gosu make"
runDeps="git libjpeg62 libopenjp2-7 libpq5 libtiff6 libxml2 libxslt1.1 lynx netcat-openbsd poppler-utils rsync wv busybox libmagic1 gosu make"
apt-get update
apt-get install -y --no-install-recommends $runDeps
busybox --install -s
Expand Down
14 changes: 9 additions & 5 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION}-slim-bullseye
ARG PYTHON_VERSION=3.12
ARG PLONE_VERSION
FROM python:${PYTHON_VERSION}-slim-bookworm

ARG PYTHON_VERSION
ARG PLONE_VERSION

LABEL maintainer="Plone Community <[email protected]>" \
org.label-schema.name="server-prod-conf" \
Expand All @@ -11,7 +15,7 @@ LABEL maintainer="Plone Community <[email protected]>" \
RUN <<EOT
set -e
useradd --system -m -d /app -U -u 500 plone
runDeps="ca-certificates git libjpeg62 libopenjp2-7 libpq5 libtiff5 libxml2 libxslt1.1 lynx netcat poppler-utils rsync wv busybox gosu libmagic1 make"
runDeps="ca-certificates git libjpeg62 libopenjp2-7 libpq5 libtiff6 libxml2 libxslt1.1 lynx netcat-openbsd poppler-utils rsync wv busybox gosu libmagic1 make"
apt-get update
apt-get -y upgrade
apt-get install -y --no-install-recommends $runDeps
Expand All @@ -23,9 +27,9 @@ RUN <<EOT
EOT

# Disable debug mode
ENV DEBUG_MODE off
ENV DEBUG_MODE=off
# Set chameleon cache directory
ENV CHAMELEON_CACHE /app/var/cache
ENV CHAMELEON_CACHE=/app/var/cache
# Disable compilation of po files into mo files (This should be done in the builder image)
ENV zope_i18n_compile_mo_files=

Expand Down
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ MAIN_IMAGE_NAME=plone/plone-backend
CLASSICUI_IMAGE_NAME=plone/plone-classicui
BASE_IMAGE_NAME=plone/server
PLONE_VERSION=$$(cat version.txt)
PYTHON_VERSION=3.12
IMAGE_TAG=${PLONE_VERSION}
NIGHTLY_IMAGE_TAG=nightly

# Code Quality
CURRENT_FOLDER=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
CODE_QUALITY_VERSION=2.1.0
CODE_QUALITY_VERSION=2.1.1
ifndef LOG_LEVEL
LOG_LEVEL=INFO
endif
Expand Down Expand Up @@ -68,37 +69,37 @@ show-image: ## Print Version
.PHONY: image-builder
image-builder: ## Build Base Image
@echo "Building $(BASE_IMAGE_NAME)-builder:$(IMAGE_TAG)"
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(BASE_IMAGE_NAME)-builder:$(IMAGE_TAG) -f Dockerfile.builder --load
@docker buildx build . --no-cache --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(BASE_IMAGE_NAME)-builder:$(IMAGE_TAG) -f Dockerfile.builder --load

.PHONY: image-dev
image-dev: ## Build Dev Image
@echo "Building $(BASE_IMAGE_NAME)-dev:$(IMAGE_TAG)"
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(BASE_IMAGE_NAME)-dev:$(IMAGE_TAG) -f Dockerfile.dev --load
@docker buildx build . --no-cache --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(BASE_IMAGE_NAME)-dev:$(IMAGE_TAG) -f Dockerfile.dev --load

.PHONY: image-prod-config
image-prod-config: ## Build Prod Image
@echo "Building $(BASE_IMAGE_NAME)-prod-config:$(IMAGE_TAG)"
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(BASE_IMAGE_NAME)-prod-config:$(IMAGE_TAG) -f Dockerfile.prod --load
@docker buildx build . --no-cache --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(BASE_IMAGE_NAME)-prod-config:$(IMAGE_TAG) -f Dockerfile.prod --load

.PHONY: image-classicui
image-classicui: ## Build Classic UI
@echo "Building $(CLASSICUI_IMAGE_NAME):$(IMAGE_TAG)"
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(CLASSICUI_IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile.classicui --load
@docker buildx build . --no-cache --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(CLASSICUI_IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile.classicui --load

.PHONY: image-acceptance
image-acceptance: ## Build Acceptance Image
@echo "Building $(BASE_IMAGE_NAME)-acceptance:$(IMAGE_TAG)"
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(BASE_IMAGE_NAME)-acceptance:$(IMAGE_TAG) -f Dockerfile.acceptance --load
@docker buildx build . --no-cache --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(BASE_IMAGE_NAME)-acceptance:$(IMAGE_TAG) -f Dockerfile.acceptance --load

.PHONY: image-main
image-main: ## Build main image
@echo "Building $(MAIN_IMAGE_NAME):$(IMAGE_TAG)"
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(MAIN_IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile --load
@docker buildx build . --no-cache --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(MAIN_IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile --load

.PHONY: image-nightly
image-nightly: ## Build Docker Image Nightly
@echo "Building $(MAIN_IMAGE_NAME):$(NIGHTLY_IMAGE_TAG)"
@docker build . -t $(MAIN_IMAGE_NAME):$(NIGHTLY_IMAGE_TAG) -f Dockerfile.nightly
@docker buildx build . --no-cache --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(MAIN_IMAGE_NAME):$(NIGHTLY_IMAGE_TAG) -f Dockerfile.nightly --load

.PHONY: build-images
build-images: ## Build Images
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ These images are **not** Buildout based!
| 6.1 | `6.1.0rc1`, `6.1` | [(6.1.x/Dockerfile)](https://github.com/plone/plone-backend/blob/v6.1.0rc1/Dockerfile)|
| 6 (nightly) | `nightly` | [(Dockerfile.nightly)](https://github.com/plone/plone-backend/blob/6.0.x/Dockerfile.nightly) |

**Possible breaking changes in upcoming Plone 6.1 dependencies**

Please note that the backend images in the 6.1.x series have several updated dependencies, which you should verify and test before using them in any existing project. Even if you extend from these images. The underlying OS has been switched from Debian 11 buster to 12 bookworm. Python is updated from
3.11 to 3.12. Relstorage has a new major release going from 3.x to 4.1. And there are are minor updates for libldap, libtiff and psycopg2 OS and Python libraries.

### Unsupported tags

**Note:**
Expand Down