From f7b6fcb6b41cf6af60fec3144acb8045efe497cf Mon Sep 17 00:00:00 2001 From: Usama Sadiq Date: Thu, 13 Jun 2024 21:15:00 +0500 Subject: [PATCH] build: upgrade edxapp docker image to python 3.11 (#34982) * build: upgrade edxapp docker image to python 3.11 --------- Co-authored-by: Tim McCormack --- .github/workflows/docker-publish.yml | 3 ++- Dockerfile | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 98a80f1da3..6831e3563d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -4,6 +4,7 @@ on: push: branches: - master + jobs: # Push image to GitHub Packages. # See also https://docs.docker.com/docker-hub/builds/ @@ -35,7 +36,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Build and push lms base docker image + - name: Build and push lms/cms base docker images env: DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/Dockerfile b/Dockerfile index 65531cbcf5..75a716177f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,20 +46,24 @@ RUN useradd -m --shell /bin/false app RUN echo "locales locales/default_environment_locale select en_US.UTF-8" | debconf-set-selections RUN echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8" | debconf-set-selections +# Setting up ppa deadsnakes to get python 3.11 +RUN apt-get update && \ + apt-get install -y software-properties-common && \ + apt-add-repository -y ppa:deadsnakes/ppa + # Install requirements that are absolutely necessary RUN apt-get update && \ apt-get -y dist-upgrade && \ apt-get -y install --no-install-recommends \ - python3 \ - python3-venv \ - python3.8 \ - python3.8-minimal \ - # python3-dev: required for building mysqlclient python package version 2.2.0 - python3-dev \ - libpython3.8 \ - libpython3.8-stdlib \ + python3-pip \ + python3.11 \ + # python3-dev: required for building mysqlclient python package + python3.11-dev \ + python3.11-venv \ + libpython3.11 \ + libpython3.11-stdlib \ libmysqlclient21 \ - # libmysqlclient-dev: required for building mysqlclient python package version 2.2.0 + # libmysqlclient-dev: required for building mysqlclient python package libmysqlclient-dev \ pkg-config \ libssl1.1 \ @@ -105,7 +109,7 @@ RUN apt-get update && \ # Setup python virtual environment # It is already 'activated' because $VIRTUAL_ENV/bin was put on $PATH -RUN python3.8 -m venv "${VIRTUAL_ENV}" +RUN python3.11 -m venv "${VIRTUAL_ENV}" # Install python requirements # Requires copying over requirements files, but not entire repository