From 1ec2dbb8191dedb263a3a2f286c00e8339277334 Mon Sep 17 00:00:00 2001 From: Cyrille Bonamy Date: Mon, 11 Nov 2024 19:21:01 +0100 Subject: [PATCH] udpate/clean docker --- doc/howtodocker.doc | 6 +----- docker/Dockerfile | 10 ++++------ docker/Dockerfile_nb | 8 ++++---- solver/overSedDymFoam/Make/files | 3 ++- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/doc/howtodocker.doc b/doc/howtodocker.doc index fea2f49ed..4ef8c513d 100644 --- a/doc/howtodocker.doc +++ b/doc/howtodocker.doc @@ -112,10 +112,6 @@ Please adapt the directories to your configuration. In this example, "/home/user \endverbatim Now hack and enjoy!\\ -The sedFoam files will be in /home/sudofoam and the solver is already compiled. Note that the bashrc file from openfoam is here: /openfoam/bash.rc\\ -And if you need python with fluidfoam installed, don't hesitate to use the preconfigured python environment: -\verbatim - source /home/sudofoam/pyenv/bin/activate -\endverbatim +The sedFoam files will be in /home/sudofoam and the solver is already compiled. Note that the bashrc file from openfoam is here: /openfoam/bash.rc and the python environment here: /home/sudofoam/pyenv\\ */ diff --git a/docker/Dockerfile b/docker/Dockerfile index ee8ea47f3..b445f2292 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,7 +15,7 @@ RUN python3 -m venv /home/sudofoam/pyenv RUN /bin/bash -c 'shopt -s expand_aliases && source /home/sudofoam/pyenv/bin/activate && pip3 install --no-cache-dir fluidfoam pandas matplotlib odfpy black' WORKDIR /root/ -RUN git clone --branch develop --recurse-submodules https://github.com/sedfoam/sedfoam.git +RUN git clone --branch develop --recurse-submodules https://github.com/sedfoam/sedfoam.git --depth 1 WORKDIR /root RUN /bin/bash -c 'hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam -b develop && cp sedfoam/docker/Allwmakeswak swak4Foam/Libraries/Allwmake' @@ -29,13 +29,11 @@ RUN /bin/bash -c 'shopt -s expand_aliases && source /openfoam/bash.rc && export WORKDIR /root/sedfoam RUN /bin/bash -c 'shopt -s expand_aliases && source /openfoam/bash.rc && export FOAM_USER_LIBBIN=$FOAM_SITE_LIBBIN && ./Allwmake -prefix=group' -WORKDIR /home/sudofoam -RUN rm -rf swak4Foam sedfoam - -USER 1000 +USER 1001 WORKDIR /home/sudofoam -RUN git clone --branch develop --recurse-submodules https://github.com/sedfoam/sedfoam.git +RUN sudo cp -r /root/sedfoam sedfoam && sudo chown -R sudofoam: /home/sudofoam && sudo rm -rf /root/* +RUN echo "source /home/sudofoam/pyenv/bin/activate" >> .bashrc WORKDIR /home/sudofoam ENV HOME=/home/sudofoam diff --git a/docker/Dockerfile_nb b/docker/Dockerfile_nb index 0cedd86d1..911f72aaa 100644 --- a/docker/Dockerfile_nb +++ b/docker/Dockerfile_nb @@ -4,7 +4,7 @@ ARG WM_NCOMPPROCS=10 ARG NB_USER="sudofoam" -ARG NB_UID="1000" +ARG NB_UID="1001" ARG NB_GID="100" # Fix DL4006 @@ -65,7 +65,7 @@ RUN sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/skel/.bashr # Add call to conda init script see https://stackoverflow.com/a/58081608/4413446 echo 'eval "$(command conda shell.bash hook 2> /dev/null)"' >> /etc/skel/.bashrc -# Create NB_USER with name jovyan user with UID=1000 and in the 'users' group +# Create NB_USER with name jovyan user with UID=1001 and in the 'users' group # and make sure these dirs are writable by the `users` group. RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \ sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers && \ @@ -79,7 +79,7 @@ RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \ # WORKDIR /home/sudofoam # RUN rm -rf .cache -USER 1000 +USER 1001 ARG PYTHON_VERSION=default @@ -100,7 +100,7 @@ ARG PYTHON_VERSION=default # COPY --chown="${NB_UID}:${NB_GID}" /root/sedfoam/docker/docker-stacks/images/docker-stacks-foundation/initial-condarc "${CONDA_DIR}/.condarc" RUN /bin/bash -c "sudo cp /root/sedfoam/docker/docker-stacks/images/docker-stacks-foundation/initial-condarc /opt/conda/.condarc" -RUN /bin/bash -c "sudo chown 1000:100 /opt/conda/.condarc" +RUN /bin/bash -c "sudo chown 1001:100 /opt/conda/.condarc" WORKDIR /tmp RUN set -x && \ arch=$(uname -m) && \ diff --git a/solver/overSedDymFoam/Make/files b/solver/overSedDymFoam/Make/files index ecf4adf32..0e181f033 100644 --- a/solver/overSedDymFoam/Make/files +++ b/solver/overSedDymFoam/Make/files @@ -1,2 +1,3 @@ overSedDymFoam.C -EXE = $(FOAM_USER_APPBIN)/overSedDymFoam_rbgh + +EXE = $(FOAM_MODULE_APPBIN)/overSedDymFoam_rbgh