Skip to content

Commit 5d9e624

Browse files
committed
Use bookworm-slim, python3.12
Fix buildx warning for ARG and ENV usage. update relstorage, python-ldap, add sasl2 for ldap installation. Fix libtiff5 to 6 Update and pin pip and wheel Remove importlibmetadata env var for older pip issue. Fix FROM/as casing warning from buildx.
1 parent 70f157e commit 5d9e624

File tree

8 files changed

+66
-46
lines changed

8 files changed

+66
-46
lines changed

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# syntax=docker/dockerfile:1
2-
ARG PYTHON_VERSION=3.11
2+
ARG PYTHON_VERSION=3.12
3+
ARG PLONE_VERSION=6.1.0rc1
4+
FROM plone/server-builder:${PLONE_VERSION} AS builder
5+
36
ARG PLONE_VERSION
4-
FROM plone/server-builder:${PLONE_VERSION} as builder
7+
58
FROM plone/server-prod-config:${PLONE_VERSION}
69

10+
ARG PYTHON_VERSION
11+
ARG PLONE_VERSION
12+
713
LABEL maintainer="Plone Community <[email protected]>" \
814
org.label-schema.name="plone-backend" \
915
org.label-schema.description="Plone backend image using Python $PYTHON_VERSION" \

Dockerfile.acceptance

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# syntax=docker/dockerfile:1
2-
ARG PYTHON_VERSION=3.11
3-
ARG PLONE_VERSION
4-
FROM plone/server-builder:${PLONE_VERSION} as builder
2+
ARG PYTHON_VERSION=3.12
3+
ARG PLONE_VERSION=6.1.0rc1
4+
FROM plone/server-builder:${PLONE_VERSION} AS builder
55

6-
# https://github.com/pypa/pip/issues/12079
7-
ENV _PIP_USE_IMPORTLIB_METADATA=0
6+
ARG PLONE_VERSION
87

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

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

13+
ARG PYTHON_VERSION
14+
ARG PLONE_VERSION
15+
1416
LABEL maintainer="Plone Community <[email protected]>" \
1517
org.label-schema.name="server-acceptance" \
1618
org.label-schema.description="Plone $PLONE_VERSION backend acceptance image using Python $PYTHON_VERSION" \
@@ -21,7 +23,7 @@ LABEL maintainer="Plone Community <[email protected]>" \
2123
COPY --from=builder --chown=500:500 /app /app
2224

2325
# Set chameleon cache directory
24-
ENV CHAMELEON_CACHE /app/var/cache
26+
ENV CHAMELEON_CACHE=/app/var/cache
2527
# Zope listens to all ip addresses
2628
ENV ZSERVER_HOST=0.0.0.0
2729
# Zope port to be 55001

Dockerfile.builder

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# syntax=docker/dockerfile:1
2-
ARG PYTHON_VERSION=3.11
3-
FROM python:${PYTHON_VERSION}-slim-bullseye
2+
ARG PYTHON_VERSION=3.12
3+
FROM python:${PYTHON_VERSION}-slim-bookworm
44

5-
ARG PLONE_VERSION
5+
ARG PLONE_VERSION=6.1.0rc1
66

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

99

1010
LABEL maintainer="Plone Community <[email protected]>" \
@@ -28,7 +28,7 @@ RUN <<EOT
2828
set -e
2929
apt-get update
3030
apt-get -y upgrade
31-
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"
31+
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 libsasl2-dev libssl-dev libtiff6 libtiff5-dev libxml2-dev libxslt1-dev wget zlib1g-dev"
3232
apt-get install -y --no-install-recommends $buildDeps
3333
busybox --install -s
3434
python -m venv /app

Dockerfile.classicui

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# syntax=docker/dockerfile:1
2-
ARG PYTHON_VERSION=3.11
2+
ARG PYTHON_VERSION=3.12
3+
ARG PLONE_VERSION=6.1.0rc1
4+
FROM plone/server-builder:${PLONE_VERSION} AS builder
5+
36
ARG PLONE_VERSION
4-
FROM plone/server-builder:${PLONE_VERSION} as builder
57

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

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

13+
ARG PYTHON_VERSION
14+
ARG PLONE_VERSION
15+
1116
LABEL maintainer="Plone Community <[email protected]>" \
1217
org.label-schema.name="plone-classicui" \
1318
org.label-schema.description="Plone $PLONE_VERSION Classic UI image using Python $PYTHON_VERSION" \

Dockerfile.dev

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# syntax=docker/dockerfile:1
2-
ARG PYTHON_VERSION=3.11
3-
ARG PLONE_VERSION
2+
ARG PYTHON_VERSION=3.12
3+
ARG PLONE_VERSION=6.1.0rc1
44
FROM plone/server-builder:${PLONE_VERSION}
55

6+
ARG PYTHON_VERSION
7+
ARG PLONE_VERSION
68

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

2123
# Turns off buffering
22-
ENV PYTHONUNBUFFERED 1
24+
ENV PYTHONUNBUFFERED=1
2325
# Keeps Python from generating .pyc files
24-
ENV PYTHONDONTWRITEBYTECODE 1
26+
ENV PYTHONDONTWRITEBYTECODE=1
2527
# Enable Application server in debug mode
26-
ENV DEBUG_MODE on
28+
ENV DEBUG_MODE=on
2729
# Disable compilation of po files into mo files
2830
ENV zope_i18n_compile_mo_files=
2931
# Set chameleon cache directory
30-
ENV CHAMELEON_CACHE /app/var/cache
32+
ENV CHAMELEON_CACHE=/app/var/cache
3133
# Expose Zope Port
3234
EXPOSE 8080
3335

Dockerfile.nightly

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# syntax=docker/dockerfile:1
2-
ARG PYTHON_VERSION=3.11
3-
FROM python:${PYTHON_VERSION}-slim-bullseye as base
4-
FROM base as builder
2+
ARG PYTHON_VERSION=3.12
3+
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
4+
FROM base AS builder
55

66
ENV PIP_PARAMS=""
7-
ENV PIP_VERSION=22.3.1
8-
ENV EXTRA_PACKAGES="relstorage==3.5.0 psycopg2==2.9.5 python-ldap==3.4.3"
7+
ENV PIP_VERSION=24.3.1
8+
ENV EXTRA_PACKAGES="relstorage==4.1.1 psycopg2==2.9.10 python-ldap==3.4.4"
99

1010
RUN mkdir /wheelhouse
1111

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

2525
WORKDIR /workspace
@@ -36,7 +36,7 @@ EOT
3636
FROM base
3737

3838
ENV PIP_PARAMS=""
39-
ENV PIP_VERSION=22.0.4
39+
ENV PIP_VERSION=24.3.1
4040

4141
LABEL maintainer="Plone Community <[email protected]>" \
4242
org.label-schema.name="plone-backend" \
@@ -48,7 +48,7 @@ COPY --from=builder /wheelhouse /wheelhouse
4848
RUN <<EOT
4949
set -e
5050
useradd --system -m -d /app -U -u 500 plone
51-
runDeps="git libjpeg62 libopenjp2-7 libpq5 libtiff5 libxml2 libxslt1.1 lynx netcat poppler-utils rsync wv busybox libmagic1 gosu make"
51+
runDeps="git libjpeg62 libopenjp2-7 libpq5 libtiff6 libxml2 libxslt1.1 lynx netcat-openbsd poppler-utils rsync wv busybox libmagic1 gosu make"
5252
apt-get update
5353
apt-get install -y --no-install-recommends $runDeps
5454
busybox --install -s

Dockerfile.prod

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# syntax=docker/dockerfile:1
2-
ARG PYTHON_VERSION=3.11
3-
FROM python:${PYTHON_VERSION}-slim-bullseye
2+
ARG PYTHON_VERSION=3.12
3+
ARG PLONE_VERSION=6.1.0rc1
4+
FROM python:${PYTHON_VERSION}-slim-bookworm
5+
6+
ARG PYTHON_VERSION
7+
ARG PLONE_VERSION
48

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

2529
# Disable debug mode
26-
ENV DEBUG_MODE off
30+
ENV DEBUG_MODE=off
2731
# Set chameleon cache directory
28-
ENV CHAMELEON_CACHE /app/var/cache
32+
ENV CHAMELEON_CACHE=/app/var/cache
2933
# Disable compilation of po files into mo files (This should be done in the builder image)
3034
ENV zope_i18n_compile_mo_files=
3135

Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ MAIN_IMAGE_NAME=plone/plone-backend
2222
CLASSICUI_IMAGE_NAME=plone/plone-classicui
2323
BASE_IMAGE_NAME=plone/server
2424
PLONE_VERSION=$$(cat version.txt)
25+
PYTHON_VERSION=3.12
2526
IMAGE_TAG=${PLONE_VERSION}
2627
NIGHTLY_IMAGE_TAG=nightly
2728

2829
# Code Quality
2930
CURRENT_FOLDER=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
30-
CODE_QUALITY_VERSION=2.1.0
31+
CODE_QUALITY_VERSION=2.1.1
3132
ifndef LOG_LEVEL
3233
LOG_LEVEL=INFO
3334
endif
@@ -68,37 +69,37 @@ show-image: ## Print Version
6869
.PHONY: image-builder
6970
image-builder: ## Build Base Image
7071
@echo "Building $(BASE_IMAGE_NAME)-builder:$(IMAGE_TAG)"
71-
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(BASE_IMAGE_NAME)-builder:$(IMAGE_TAG) -f Dockerfile.builder --load
72+
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(BASE_IMAGE_NAME)-builder:$(IMAGE_TAG) -f Dockerfile.builder --load
7273

7374
.PHONY: image-dev
7475
image-dev: ## Build Dev Image
7576
@echo "Building $(BASE_IMAGE_NAME)-dev:$(IMAGE_TAG)"
76-
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(BASE_IMAGE_NAME)-dev:$(IMAGE_TAG) -f Dockerfile.dev --load
77+
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(BASE_IMAGE_NAME)-dev:$(IMAGE_TAG) -f Dockerfile.dev --load
7778

7879
.PHONY: image-prod-config
7980
image-prod-config: ## Build Prod Image
8081
@echo "Building $(BASE_IMAGE_NAME)-prod-config:$(IMAGE_TAG)"
81-
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(BASE_IMAGE_NAME)-prod-config:$(IMAGE_TAG) -f Dockerfile.prod --load
82+
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(BASE_IMAGE_NAME)-prod-config:$(IMAGE_TAG) -f Dockerfile.prod --load
8283

8384
.PHONY: image-classicui
8485
image-classicui: ## Build Classic UI
8586
@echo "Building $(CLASSICUI_IMAGE_NAME):$(IMAGE_TAG)"
86-
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(CLASSICUI_IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile.classicui --load
87+
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(CLASSICUI_IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile.classicui --load
8788

8889
.PHONY: image-acceptance
8990
image-acceptance: ## Build Acceptance Image
9091
@echo "Building $(BASE_IMAGE_NAME)-acceptance:$(IMAGE_TAG)"
91-
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(BASE_IMAGE_NAME)-acceptance:$(IMAGE_TAG) -f Dockerfile.acceptance --load
92+
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(BASE_IMAGE_NAME)-acceptance:$(IMAGE_TAG) -f Dockerfile.acceptance --load
9293

9394
.PHONY: image-main
9495
image-main: ## Build main image
9596
@echo "Building $(MAIN_IMAGE_NAME):$(IMAGE_TAG)"
96-
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} -t $(MAIN_IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile --load
97+
@docker buildx build . --build-arg PLONE_VERSION=${PLONE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(MAIN_IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile --load
9798

9899
.PHONY: image-nightly
99100
image-nightly: ## Build Docker Image Nightly
100101
@echo "Building $(MAIN_IMAGE_NAME):$(NIGHTLY_IMAGE_TAG)"
101-
@docker build . -t $(MAIN_IMAGE_NAME):$(NIGHTLY_IMAGE_TAG) -f Dockerfile.nightly
102+
@docker buildx build . --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t $(MAIN_IMAGE_NAME):$(NIGHTLY_IMAGE_TAG) -f Dockerfile.nightly --load
102103

103104
.PHONY: build-images
104105
build-images: ## Build Images

0 commit comments

Comments
 (0)