diff mbox series

[ovs-dev,3/7] ci: Update the Ubuntu container to 24.04.

Message ID 20240514083851.417951-4-amusil@redhat.com
State Accepted
Headers show
Series Bump of CI Ubuntu and Fedora versions | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Ales Musil May 14, 2024, 8:38 a.m. UTC
The Ubuntu 24.04 marks the Python installation as externally managed
this prevents pip from installing system-wide packages. Set the
PIP_BREAK_SYSTEM_PACKAGES env variable that allows pip to ignore
this and install the packages anyway.

At the same time the Python Babel fails to detect timezone when
it is just set to UTC. Setting it to Etc/UTC fixes the issue:

ValueError: ZoneInfo keys may not be absolute paths, got: /UTC

Signed-off-by: Ales Musil <amusil@redhat.com>
---
 utilities/containers/ubuntu/Dockerfile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/utilities/containers/ubuntu/Dockerfile b/utilities/containers/ubuntu/Dockerfile
index ac1e6a5bf..c1ff711c5 100755
--- a/utilities/containers/ubuntu/Dockerfile
+++ b/utilities/containers/ubuntu/Dockerfile
@@ -1,4 +1,4 @@ 
-FROM registry.hub.docker.com/library/ubuntu:22.04
+FROM registry.hub.docker.com/library/ubuntu:24.04
 
 ARG CONTAINERS_PATH
 
@@ -37,6 +37,7 @@  RUN apt update -y \
         selinux-policy-dev \
         sudo \
         tcpdump \
+        tzdata \
         wget \
     && \
     apt autoremove \
@@ -73,6 +74,10 @@  WORKDIR /workspace
 
 COPY $CONTAINERS_PATH/py-requirements.txt /tmp/py-requirements.txt
 
+# Ubuntu 24.04 marks the Python installation as externally managed, allow pip
+# to install the packages despite that.
+ENV PIP_BREAK_SYSTEM_PACKAGES 1
+
 # Update and install pip dependencies
 RUN python3 -m pip install --upgrade pip \
     && \
@@ -80,4 +85,7 @@  RUN python3 -m pip install --upgrade pip \
     && \
     python3 -m pip install -r /tmp/py-requirements.txt
 
+# The Python Babel fails to detect timezone when it is set to UTC only.
+ENV TZ Etc/UTC
+
 CMD ["/sbin/init"]