From fdf73b62e3a3931578f5236c21e5f2e1f51fe6c6 Mon Sep 17 00:00:00 2001 From: Jhony Avella Date: Tue, 22 Oct 2024 16:07:32 -0500 Subject: [PATCH] Ubuntu 24.04 Upgrade (#39) * chore: notes service now uses ubuntu 24.04 as base image * chore: using 1000 UID. Updating setuptools * chore: adding changelog entry --- ...241022_103249_jhony.avella_ubuntu_24_04.md | 1 + .../templates/notes/build/notes/Dockerfile | 23 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md diff --git a/changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md b/changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md new file mode 100644 index 0000000..e9b30a6 --- /dev/null +++ b/changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md @@ -0,0 +1 @@ +- 💥[Feature] Update Notes Image to use Ubuntu 24.04 as base OS. (by @jfavellar90) diff --git a/tutornotes/templates/notes/build/notes/Dockerfile b/tutornotes/templates/notes/build/notes/Dockerfile index 4fea8b4..7bd90db 100644 --- a/tutornotes/templates/notes/build/notes/Dockerfile +++ b/tutornotes/templates/notes/build/notes/Dockerfile @@ -1,21 +1,24 @@ # syntax=docker/dockerfile:1.4 -FROM docker.io/python:3.12-slim-bookworm +FROM docker.io/ubuntu:24.04 ENV DEBIAN_FRONTEND=noninteractive + +# Delete default UID=1000 `ubuntu` user to ensure we can use id 1000 for app user +RUN userdel -r ubuntu + RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ apt update && \ apt upgrade -y && \ apt install -y \ - locales \ + language-pack-en \ git \ - python3-dev \ - build-essential \ - default-libmysqlclient-dev \ - pkg-config && \ - sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ - locale-gen -ENV LC_ALL=en_US.UTF-8 + python3 \ + python3-pip \ + python3-venv \ + libmysqlclient-dev \ + pkg-config +RUN ln -s /usr/bin/python3 /usr/bin/python ###### Git-clone Notes repo ###### ARG APP_USER_ID=1000 @@ -31,7 +34,7 @@ ENV PATH=/app/venv/bin:${PATH} # https://pypi.org/project/setuptools/ # https://pypi.org/project/pip/ # https://pypi.org/project/wheel/ -RUN --mount=type=cache,target=/app/.cache/pip,sharing=shared pip install setuptools==69.2.0 pip==24.0 wheel==0.43.0 +RUN --mount=type=cache,target=/app/.cache/pip,sharing=shared pip install setuptools==75.2.0 pip==24.2 wheel==0.44.0 RUN --mount=type=cache,target=/app/.cache/pip,sharing=shared pip install -r requirements/base.txt EXPOSE 8000