From fe56d3cbb51c100edf02c61fb8653ea123a7f70f Mon Sep 17 00:00:00 2001 From: Elian Loraux <elian.loraux@tetras-libre.fr> Date: Tue, 25 Feb 2025 11:18:45 +0100 Subject: [PATCH] reorganisate as dockerlayer --- Dockerfile | 36 ++++++++++++++++--------- docker-compose.yml | 7 ++--- install-script/install-anaconda.sh | 9 ------- install-script/install-spyder-ubuntu.sh | 33 ----------------------- install-script/install-spyder.sh | 3 --- ports.yml | 3 --- 6 files changed, 27 insertions(+), 64 deletions(-) delete mode 100644 install-script/install-anaconda.sh delete mode 100755 install-script/install-spyder-ubuntu.sh delete mode 100644 install-script/install-spyder.sh diff --git a/Dockerfile b/Dockerfile index c0bfe3d..4e92324 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,34 @@ -FROM kasmweb/core-ubuntu-jammy:1.15.0 +FROM kasmweb/core-ubuntu-noble:1.16.0 as kasmvnc-base USER root RUN apt-get update -RUN apt-get upgrade -y +RUN mkdir /install +# === Install anaconda === # +FROM kasmvnc-base as kasmvnc-anaconda -ENV INST_DIR=/install \ - INST_SCRIPTS="/install-spyder-ubuntu.sh\ - /install-anaconda.sh" +WORKDIR /install +RUN wget https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh -# Copy install scripts -RUN mkdir $INST_DIR -COPY ./install-script/ $INST_DIR +RUN bash Anaconda3-2024.02-1-Linux-x86_64.sh -b -# Run installations -RUN \ - for SCRIPT in $INST_SCRIPTS; do \ - bash ${INST_DIR}${SCRIPT} || exit 1; \ - done +RUN chmod u+x /home/kasm-user/anaconda3/etc/profile.d/conda.sh +RUN echo "source ~/anaconda3/etc/profile.d/conda.sh" >> /home/kasm-default-profile/.bashrc +RUN echo "conda activate" >> /home/kasm-default-profile/.bashrc + +USER 1000 + +# === Install Spyder === # +FROM kasmvnc-base as kasmvnc-spyder + +RUN apt-get install -y python3-spyder +USER 1000 + +# === Install mathlab === # +FROM kasmvnc-base as kasmvnc-mathlab + +RUN apt-get install -y python3-spyder USER 1000 diff --git a/docker-compose.yml b/docker-compose.yml index ef1de85..1e5831b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,10 @@ -version: "3" - services: kasm: image: kasm-ubuntu - build: ./ + build: + context: ./ + target: kasmvnc-user + container_name: KasmVNC-ubuntu volumes: - ./homedir:/home/kasm_user:rw diff --git a/install-script/install-anaconda.sh b/install-script/install-anaconda.sh deleted file mode 100644 index 36cf542..0000000 --- a/install-script/install-anaconda.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -wget https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh - -bash Anaconda3-2023.09-0-Linux-x86_64.sh -b - -chown kasm-user:kasm-user anaconda3 - -cat anaconda3/etc/profile.d/conda.sh >> /home/kasm-default-profile/.bashrc diff --git a/install-script/install-spyder-ubuntu.sh b/install-script/install-spyder-ubuntu.sh deleted file mode 100755 index a744725..0000000 --- a/install-script/install-spyder-ubuntu.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# Installation de spyder3 -apt-get update --fix-missing -apt-get install spyder3 -y - -# Ce script resout un problème de Spyder 4.2.1 -# La résolution de se problème ressort du poste stack overflow suivant -# https://stackoverflow.com/questions/72114520/error-when-starting-spyder-on-ubuntu-22-04 - -# Les lignes à commanter dans -# /usr/lib/python3/dist-packages/spyder/plugins/completion/kite/widgets/install.py : - -filetochange="/usr/lib/python3/dist-packages/spyder/plugins/completion/kite/widgets/install.py" - -# l58 -# image = image.scaled(image_width, image_height, Qt.KeepAspectRatio, -# Qt.SmoothTransformation) - -sed -i '58,59 s/^/#/' $filetochange - -# l145 -# install_gif.setScaledSize(QSize(image_width, image_height)) - -sed -e 's/install_gif\.setScaledSize/# install_gif\.setScaledSize/' -i $filetochange - -# l245-l248 -# copilot_label.setPixmap( -# copilot_image.scaled(image_width, image_height, -# Qt.KeepAspectRatio, -# Qt.SmoothTransformation)) - -sed -i '245,248 s/^/#/' $filetochange diff --git a/install-script/install-spyder.sh b/install-script/install-spyder.sh deleted file mode 100644 index d551672..0000000 --- a/install-script/install-spyder.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -apt-get install spyder -y diff --git a/ports.yml b/ports.yml index a819c47..1864e60 100644 --- a/ports.yml +++ b/ports.yml @@ -1,7 +1,4 @@ -version: "3" - services: kasm: ports: - 6901:6901 - -- GitLab