diff mbox series

[layerindex-web,2/3] Dockerfile: move to Ubuntu noble (24.04)

Message ID 20261024222633.84011-2-tim.orling@konsulko.com
State New
Headers show
Series [layerindex-web,1/3] requirements.txt: fix djangorestframework and GitPython vulnerabilities | expand

Commit Message

Tim Orling Oct. 24, 2026, 10:26 p.m. UTC
Ubuntu jammy's Python 3.10 is too old for current releases of some
dependencies, e.g. Pillow 13 needs Python 3.11 or later; noble has
Python 3.12.

Noble has no python2, so drop it; it was only needed for OE-Classic and
branches up to krogoth, none of which have updates enabled. Allow pip to
install into the system Python (PEP 668), skip upgrading the
distribution's own pip and setuptools, install adduser, which the noble
base image lacks, and keep /home/layers as the layers user's home,
which noble's adduser --system no longer creates by default.

Python 3.12 removed asyncore, which the pyinotify bundled with BitBake
for dunfell and hardknott imports; add the pyasyncore backport.

AI-Generated: Claude Opus 5.5
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 Dockerfile       | 9 ++++-----
 requirements.txt | 1 +
 2 files changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/Dockerfile b/Dockerfile
index 4ba040e..ee59e77 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,11 +1,12 @@ 
 # See README.md for how to use this.
 
-FROM ubuntu:jammy
+FROM ubuntu:noble
 LABEL maintainer="Michael Halstead <mhalstead@linuxfoundation.org>"
 
 ARG APP_DIR=/opt
 ENV APP_DIR=${APP_DIR}
 ENV PYTHONUNBUFFERED=1 \
+    PIP_BREAK_SYSTEM_PACKAGES=1 \
     LANGUAGE=en_US \
     LANG=en_US.UTF-8 \
     LC_ALL=en_US.UTF-8 \
@@ -24,6 +25,7 @@  RUN DEBIAN_FRONTEND=noninteractive apt-get update \
         && locale-gen en_US.UTF-8 \
         && update-locale \
     && apt-get install -y --no-install-recommends \
+	adduser \
 	autoconf \
 	cpio \
 	curl \
@@ -36,7 +38,6 @@  RUN DEBIAN_FRONTEND=noninteractive apt-get update \
 	make \
 	netcat-openbsd \
 	pkg-config \
-	python2 \
 	python3-dev \
 	python3-pip \
 	python3-wheel \
@@ -48,8 +49,6 @@  RUN DEBIAN_FRONTEND=noninteractive apt-get update \
     && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
 	&& locale-gen en_US.UTF-8 \
 	&& update-locale \
-    && pip3 install pip --upgrade \
-    && pip3 install setuptools --upgrade \
     && pip3 install gunicorn \
     && pip3 install -r /requirements.txt \
     && apt-get purge -y autoconf g++ make python3-dev pkg-config libjpeg-dev \
@@ -66,7 +65,7 @@  COPY docker/migrate.sh ${APP_DIR}/migrate.sh
 COPY docker/connectivity_check.sh ${APP_DIR}/connectivity_check.sh
 
 RUN mkdir ${APP_DIR}/workdir \
-	&& adduser --system --uid=500 layers \
+	&& adduser --system --uid=500 --home /home/layers layers \
 	&& chown -R layers ${APP_DIR}/workdir
 USER layers
 
diff --git a/requirements.txt b/requirements.txt
index a0d32c2..3da41f9 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -28,6 +28,7 @@  mysqlclient==2.2.8
 packaging_legacy==23.0.post0
 Pillow==12.3.0
 prompt-toolkit==3.0.53
+pyasyncore==1.0.5
 python-dateutil==2.9.0.post0
 pytz==2026.3.post1
 six==1.17.0