From e3803ff90a0410e972bae10d183b18e14149ac2e Mon Sep 17 00:00:00 2001 From: jfavellar90 Date: Mon, 2 Sep 2024 21:34:16 -0500 Subject: [PATCH 1/3] chore: notes service now uses ubuntu 24.04 as base image --- .../templates/notes/build/notes/Dockerfile | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tutornotes/templates/notes/build/notes/Dockerfile b/tutornotes/templates/notes/build/notes/Dockerfile index 4fea8b4..ba3aefc 100644 --- a/tutornotes/templates/notes/build/notes/Dockerfile +++ b/tutornotes/templates/notes/build/notes/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.4 -FROM docker.io/python:3.12-slim-bookworm +FROM docker.io/ubuntu:24.04 ENV DEBIAN_FRONTEND=noninteractive RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ @@ -7,18 +7,17 @@ RUN --mount=type=cache,target=/var/cache/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 +ARG APP_USER_ID=1001 RUN useradd --home-dir /app --create-home --shell /bin/bash --uid ${APP_USER_ID} app USER ${APP_USER_ID} @@ -31,7 +30,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==74.1.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 From 3917e1a4f938ca556396de04175334d3aafaf2a8 Mon Sep 17 00:00:00 2001 From: jfavellar90 Date: Mon, 21 Oct 2024 14:08:42 -0500 Subject: [PATCH 2/3] chore: using 1000 UID. Updating setuptools --- tutornotes/templates/notes/build/notes/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tutornotes/templates/notes/build/notes/Dockerfile b/tutornotes/templates/notes/build/notes/Dockerfile index ba3aefc..7bd90db 100644 --- a/tutornotes/templates/notes/build/notes/Dockerfile +++ b/tutornotes/templates/notes/build/notes/Dockerfile @@ -2,6 +2,10 @@ 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 && \ @@ -17,7 +21,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ RUN ln -s /usr/bin/python3 /usr/bin/python ###### Git-clone Notes repo ###### -ARG APP_USER_ID=1001 +ARG APP_USER_ID=1000 RUN useradd --home-dir /app --create-home --shell /bin/bash --uid ${APP_USER_ID} app USER ${APP_USER_ID} @@ -30,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==74.1.0 pip==24.2 wheel==0.44.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 From cea2a1948bb9a010a0ab90104bf72f65364c8ae7 Mon Sep 17 00:00:00 2001 From: jfavellar90 Date: Tue, 22 Oct 2024 11:52:05 -0500 Subject: [PATCH 3/3] chore: adding changelog entry --- changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md | 1 + 1 file changed, 1 insertion(+) 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)