diff --git a/keras3-cpu/Dockerfile b/keras3-cpu/Dockerfile index b5e977d3576c8dd909138a2f5fd722623585991c..92597b35c8c86b4315848735bd663e8c20a16c94 100644 --- a/keras3-cpu/Dockerfile +++ b/keras3-cpu/Dockerfile @@ -149,6 +149,8 @@ USER root # activate extensions by default COPY plugin.jupyterlab-settings "/home/${NB_USER}/.jupyter/lab/user-settings/@jupyterlab/extensionmanager-extension/" COPY plugin.jupyterlab-settings "/home/${NB_USER}/.jupyter/lab/user-settings/@jupyter-server/resource-usage/" +# source mamba.sh in bash using /etc/profile.d/conda.sh (workaround for removed mamba init --system, see https://github.com/mamba-org/mamba/issues/3691) +COPY conda.sh "/etc/profile.d/" RUN chown -R ${NB_USER} "/home/${NB_USER}/.jupyter" && \ # history search with Page Up/Down sed -i "s/^# \(.*history-search.*\)/\1/" /etc/inputrc && \ @@ -174,8 +176,6 @@ RUN chown -R ${NB_USER} "/home/${NB_USER}/.jupyter" && \ ' fi' \ 'done' \ >> /usr/local/bin/start-notebook.d/fix-gitlab-server.sh && \ - # source mamba.sh in bash using /etc/profile.d/conda.sh - mamba init --system && \ chown -R ${NB_USER} "/home/${NB_USER}/.local" && \ fix-permissions "/home/${NB_USER}" && \ fix-permissions "/etc/skel" diff --git a/keras3-cpu/conda.sh b/keras3-cpu/conda.sh new file mode 100644 index 0000000000000000000000000000000000000000..824b6ce4e88321561297b7ac6b29f19303c93686 --- /dev/null +++ b/keras3-cpu/conda.sh @@ -0,0 +1,18 @@ +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/opt/conda/bin/conda' 'shell.posix' 'hook' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/opt/conda/etc/profile.d/conda.sh" ]; then + . "/opt/conda/etc/profile.d/conda.sh" + else + export PATH="/opt/conda/bin:$PATH" + fi +fi +unset __conda_setup + +if [ -f "/opt/conda/etc/profile.d/mamba.sh" ]; then + . "/opt/conda/etc/profile.d/mamba.sh" +fi +# <<< conda initialize <<< diff --git a/keras3-gpu/Dockerfile b/keras3-gpu/Dockerfile index a1f83e1d3a5cccd191f4f37e94efe16408b4e546..5552230f812b8bb7c12c0b7e1ee7f850eba92bbb 100644 --- a/keras3-gpu/Dockerfile +++ b/keras3-gpu/Dockerfile @@ -110,6 +110,8 @@ RUN pip install --no-cache-dir \ USER root # activate extensions by default COPY plugin.jupyterlab-settings "/home/${NB_USER}/.jupyter/lab/user-settings/@jupyterlab/extensionmanager-extension/" +# source mamba.sh in bash using /etc/profile.d/conda.sh (workaround for removed mamba init --system, see https://github.com/mamba-org/mamba/issues/3691) +COPY conda.sh "/etc/profile.d/" RUN chown -R ${NB_USER} "/home/${NB_USER}/.jupyter" && \ # history search with Page Up/Down sed -i "s/^# \(.*history-search.*\)/\1/" /etc/inputrc && \ @@ -135,8 +137,6 @@ RUN chown -R ${NB_USER} "/home/${NB_USER}/.jupyter" && \ ' fi' \ 'done' \ >> /usr/local/bin/start-notebook.d/fix-gitlab-server.sh && \ - # source mamba.sh in bash using /etc/profile.d/conda.sh - mamba init --system && \ chown -R ${NB_USER} "/home/${NB_USER}/.local" && \ fix-permissions "/home/${NB_USER}" && \ fix-permissions "/etc/skel" diff --git a/keras3-gpu/conda.sh b/keras3-gpu/conda.sh new file mode 100644 index 0000000000000000000000000000000000000000..824b6ce4e88321561297b7ac6b29f19303c93686 --- /dev/null +++ b/keras3-gpu/conda.sh @@ -0,0 +1,18 @@ +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/opt/conda/bin/conda' 'shell.posix' 'hook' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/opt/conda/etc/profile.d/conda.sh" ]; then + . "/opt/conda/etc/profile.d/conda.sh" + else + export PATH="/opt/conda/bin:$PATH" + fi +fi +unset __conda_setup + +if [ -f "/opt/conda/etc/profile.d/mamba.sh" ]; then + . "/opt/conda/etc/profile.d/mamba.sh" +fi +# <<< conda initialize <<< diff --git a/pytorch-gpu/Dockerfile b/pytorch-gpu/Dockerfile index 479c01ea2e2171cf5d03cf1f2d5c7c07ef075128..6c9fd719564f2bbf89f9debee301d3db3d35dea0 100644 --- a/pytorch-gpu/Dockerfile +++ b/pytorch-gpu/Dockerfile @@ -110,6 +110,8 @@ RUN conda install --yes --no-update-deps \ USER root # activate extensions by default COPY plugin.jupyterlab-settings "/home/${NB_USER}/.jupyter/lab/user-settings/@jupyterlab/extensionmanager-extension/" +# source mamba.sh in bash using /etc/profile.d/conda.sh (workaround for removed mamba init --system, see https://github.com/mamba-org/mamba/issues/3691) +COPY conda.sh "/etc/profile.d/" RUN chown -R ${NB_USER} "/home/${NB_USER}/.jupyter" && \ # history search with Page Up/Down sed -i "s/^# \(.*history-search.*\)/\1/" /etc/inputrc && \ @@ -135,8 +137,6 @@ RUN chown -R ${NB_USER} "/home/${NB_USER}/.jupyter" && \ ' fi' \ 'done' \ >> /usr/local/bin/start-notebook.d/fix-gitlab-server.sh && \ - # source mamba.sh in bash using /etc/profile.d/conda.sh - mamba init --system && \ chown -R ${NB_USER} "/home/${NB_USER}/.local" && \ fix-permissions "/home/${NB_USER}" && \ fix-permissions "/etc/skel" diff --git a/pytorch-gpu/conda.sh b/pytorch-gpu/conda.sh new file mode 100644 index 0000000000000000000000000000000000000000..824b6ce4e88321561297b7ac6b29f19303c93686 --- /dev/null +++ b/pytorch-gpu/conda.sh @@ -0,0 +1,18 @@ +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/opt/conda/bin/conda' 'shell.posix' 'hook' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/opt/conda/etc/profile.d/conda.sh" ]; then + . "/opt/conda/etc/profile.d/conda.sh" + else + export PATH="/opt/conda/bin:$PATH" + fi +fi +unset __conda_setup + +if [ -f "/opt/conda/etc/profile.d/mamba.sh" ]; then + . "/opt/conda/etc/profile.d/mamba.sh" +fi +# <<< conda initialize <<<