From fb3a60780cabf3e8cf561c1878a9aa13a589532a Mon Sep 17 00:00:00 2001 From: a6ar55 Date: Fri, 13 Oct 2023 18:42:21 +0530 Subject: [PATCH 1/3] modified to python3 --- docker/base.dockerfile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/docker/base.dockerfile b/docker/base.dockerfile index 8609a195245..0782bd6b7a1 100644 --- a/docker/base.dockerfile +++ b/docker/base.dockerfile @@ -1,6 +1,8 @@ FROM ubuntu:bionic ENV NODE_VERSION=16.20.0 +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 # install required packages RUN apt-get update && \ @@ -11,9 +13,9 @@ RUN apt-get update && \ git \ git-lfs \ psmisc \ - python2.7 \ - python-pip \ - python-sphinx + python3 \ + python3-pip \ + python3-sphinx # add yarn ppa RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - @@ -21,19 +23,24 @@ RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources # install nodejs and yarn RUN apt-get update && \ - curl -sSO https://deb.nodesource.com/node_16.x/pool/main/n/nodejs/nodejs_$NODE_VERSION-1nodesource1_amd64.deb && \ - dpkg -i ./nodejs_$NODE_VERSION-1nodesource1_amd64.deb && \ - rm nodejs_$NODE_VERSION-1nodesource1_amd64.deb && \ + ARCH=$(dpkg --print-architecture) && \ + curl -sSO https://deb.nodesource.com/node_16.x/pool/main/n/nodejs/nodejs_$NODE_VERSION-1nodesource1_$ARCH.deb && \ + dpkg -i ./nodejs_$NODE_VERSION-1nodesource1_$ARCH.deb && \ + rm nodejs_$NODE_VERSION-1nodesource1_$ARCH.deb && \ apt-get install yarn RUN git lfs install +# Check if symbolic links exist before creating them +RUN if [ ! -f /usr/bin/python ]; then ln -s /usr/bin/python3 /usr/bin/python; fi \ + && if [ ! -f /usr/bin/pip ]; then ln -s /usr/bin/pip3 /usr/bin/pip; fi + # copy Kolibri source code into image COPY . /kolibri # do the time-consuming base install commands RUN cd /kolibri \ - && pip install -r requirements/dev.txt \ - && pip install -r requirements/build.txt \ - && pip install -r requirements/test.txt \ + && pip3 install -r requirements/dev.txt \ + && pip3 install -r requirements/build.txt \ + && pip3 install -r requirements/test.txt \ && yarn install --network-timeout 100000 From a33876cf46583af6120280d544f105e3050ac2dc Mon Sep 17 00:00:00 2001 From: a6ar55 Date: Tue, 17 Oct 2023 00:59:11 +0530 Subject: [PATCH 2/3] updated base image from to jammy,removed build.txt --- docker/base.dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docker/base.dockerfile b/docker/base.dockerfile index 0782bd6b7a1..61a2ca8ce89 100644 --- a/docker/base.dockerfile +++ b/docker/base.dockerfile @@ -1,8 +1,6 @@ -FROM ubuntu:bionic +FROM ubuntu:jammy ENV NODE_VERSION=16.20.0 -ENV LC_ALL C.UTF-8 -ENV LANG C.UTF-8 # install required packages RUN apt-get update && \ @@ -41,6 +39,5 @@ COPY . /kolibri # do the time-consuming base install commands RUN cd /kolibri \ && pip3 install -r requirements/dev.txt \ - && pip3 install -r requirements/build.txt \ && pip3 install -r requirements/test.txt \ && yarn install --network-timeout 100000 From d94d70d869c53f35dcb9069f10e91c06becba38f Mon Sep 17 00:00:00 2001 From: Blaine Jester Date: Mon, 16 Oct 2023 14:43:04 -0700 Subject: [PATCH 3/3] Update docker env var for which python version to use --- docker/demoserver.dockerfile | 1 - docker/entrypoint.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/demoserver.dockerfile b/docker/demoserver.dockerfile index 55547ee8aed..2bd8bee69b4 100644 --- a/docker/demoserver.dockerfile +++ b/docker/demoserver.dockerfile @@ -2,7 +2,6 @@ FROM learningequality/kolibribase ENV KOLIBRI_RUN_MODE=demoserver ENV KOLIBRI_PROVISIONDEVICE_FACILITY="Kolibri Demo" -ENV WHICH_PYTHON=python2 COPY docker/entrypoint.py /docker/entrypoint.py diff --git a/docker/entrypoint.py b/docker/entrypoint.py index d95d011bc8a..2a5e0a15669 100644 --- a/docker/entrypoint.py +++ b/docker/entrypoint.py @@ -38,7 +38,7 @@ # - KOLIBRI_PROVISIONDEVICE_FACILITY if set, provision facility with this name # - CHANNELS_TO_IMPORT if set, comma separated list of channel IDs to import DEFAULT_ENVS = { - "WHICH_PYTHON": "python2", # or python3 if you prefer; Kolibri don't care + "WHICH_PYTHON": "python3", # or python3 if you prefer; Kolibri don't care "KOLIBRI_HOME": "/kolibrihome", "KOLIBRI_HTTP_PORT": "8080", "KOLIBRI_LANG": "en",