From 79bf391aef7cf42d9684a713eaaa599c2a657951 Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Fri, 22 Mar 2024 11:18:15 +0500 Subject: [PATCH 1/2] upgrade python version to 3.12.2 --- changelog.d/20240322_111437_fahad.khalid.md | 1 + .../cairn/build/cairn-clickhouse/Dockerfile | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 changelog.d/20240322_111437_fahad.khalid.md diff --git a/changelog.d/20240322_111437_fahad.khalid.md b/changelog.d/20240322_111437_fahad.khalid.md new file mode 100644 index 0000000..69924f1 --- /dev/null +++ b/changelog.d/20240322_111437_fahad.khalid.md @@ -0,0 +1 @@ +- 💥[Feature] Upgrade Python version to 3.12.2 (by @Fahadkhalid210) \ No newline at end of file diff --git a/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile b/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile index 32af310..4f07225 100644 --- a/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile +++ b/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile @@ -6,7 +6,24 @@ FROM docker.io/yandex/clickhouse-server:22.1.3.7 # curl https://repo.yandex.ru/clickhouse/deb/stable/ # The above command should be a 200, and not a 404. RUN rm /etc/apt/sources.list.d/clickhouse.list -RUN apt update && apt install -y python3 +RUN apt update && apt install -y git build-essential libssl-dev zlib1g-dev \ +libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \ +libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev + + COPY ./scripts /scripts RUN chmod a+x /scripts/* -ENV PATH /scripts:${PATH} +# Install pyenv +# https://www.python.org/downloads/ +# https://github.com/pyenv/pyenv/releases +ARG PYTHON_VERSION=3.12.2 +ENV PYENV_ROOT /opt/pyenv +RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1 +# Install Python +RUN $PYENV_ROOT/bin/pyenv install $PYTHON_VERSION + + +RUN $PYENV_ROOT/bin/pyenv global $PYTHON_VERSION + + +ENV PATH /opt/pyenv/shims:/opt/pyenv/bin:/scripts:${PATH} From d2e837fb323983b876c506b1da292ac1e334ab6b Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Fri, 22 Mar 2024 11:21:15 +0500 Subject: [PATCH 2/2] improved code --- tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile b/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile index 4f07225..00be60f 100644 --- a/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile +++ b/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile @@ -10,7 +10,6 @@ RUN apt update && apt install -y git build-essential libssl-dev zlib1g-dev \ libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \ libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev - COPY ./scripts /scripts RUN chmod a+x /scripts/* # Install pyenv @@ -21,9 +20,6 @@ ENV PYENV_ROOT /opt/pyenv RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1 # Install Python RUN $PYENV_ROOT/bin/pyenv install $PYTHON_VERSION - - RUN $PYENV_ROOT/bin/pyenv global $PYTHON_VERSION - ENV PATH /opt/pyenv/shims:/opt/pyenv/bin:/scripts:${PATH}