Skip to content

Commit

Permalink
udpate/clean docker
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrilleBonamy committed Nov 11, 2024
1 parent 5090069 commit 1ec2dbb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
6 changes: 1 addition & 5 deletions doc/howtodocker.doc
Original file line number Diff line number Diff line change
Expand Up @@ -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\\

*/
10 changes: 4 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docker/Dockerfile_nb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 && \
Expand All @@ -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


Expand All @@ -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) && \
Expand Down
3 changes: 2 additions & 1 deletion solver/overSedDymFoam/Make/files
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
overSedDymFoam.C
EXE = $(FOAM_USER_APPBIN)/overSedDymFoam_rbgh

EXE = $(FOAM_MODULE_APPBIN)/overSedDymFoam_rbgh

0 comments on commit 1ec2dbb

Please sign in to comment.