@@ -5,8 +5,6 @@ FROM ithacafv/ithacafv-dependencies:${TARGETARCH} AS base
55
66LABEL maintainer=
"[email protected] " 77
8- USER root
9-
108# Install additional packages
119RUN apt-get update && \
1210 apt-get install -y \
@@ -18,62 +16,32 @@ RUN apt-get update && \
1816 software-properties-common && \
1917 rm -rf /var/lib/apt/lists/*
2018
21- # Create ithacafv user and group
22- ARG USER=ithacafv
23- RUN if id -u 1000 >/dev/null 2>&1; then \
24- userdel $(id -nu 1000) || true; \
25- fi && \
26- if getent group 1000 >/dev/null 2>&1; then \
27- groupdel $(getent group 1000 | cut -d: -f1) || true; \
28- fi && \
29- adduser --disabled-password --gecos '' --uid 1000 $USER && \
30- adduser $USER sudo && \
31- echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
32-
33- # Set environment variables
34- ENV HOME=/home/$USER
35- ENV USER=$USER
36-
3719# Set working directory and clone ITHACA-FV
38- WORKDIR /opt
39- RUN git clone https://github.com/mathLab/ITHACA-FV.git && \
40- chown -R $USER:$USER ITHACA-FV && \
41- chown -R $USER:$USER /home/$USER
20+ WORKDIR /usr/dir
21+ RUN git clone https://github.com/ITHACA-FV/ITHACA-FV.git
4222
4323# Environment variables for bashrc
44- ARG of_var="source /usr/lib/openfoam/openfoam2412/etc /bashrc"
24+ ARG of_var="source \$ FOAM_ETC /bashrc"
4525ARG ithaca_var="source /opt/ITHACA-FV/etc/bashrc"
4626
4727# Update bashrc with OpenFOAM and ITHACA-FV sources
4828RUN echo $of_var >> /etc/bash.bashrc && \
4929 echo $ithaca_var >> /etc/bash.bashrc
5030
51- # Switch to ithacafv user
52- USER $USER
31+ # Update bashrc with OpenFOAM and ITHACA-FV sources
32+ RUN echo $of_var >> /etc/bash.bashrc && \
33+ echo $ithaca_var >> /etc/bash.bashrc
34+
5335
54- # Build ITHACA-FV with architecture-specific flags
55- RUN /bin/bash -c "source /usr/lib/openfoam/openfoam2412/etc/bashrc && \
56- cd ITHACA-FV && \
57- git submodule update --init && \
58- source etc/bashrc && \
36+ RUN /bin/bash -c "source \$ FOAM_ETC/bashrc && \
37+ cd ITHACA-FV && git submodule update --init && source etc/bashrc && \
5938 if [ \" $TARGETARCH\" = \" amd64\" ]; then \
6039 ./Allwmake -taumq -j 4; \
6140 else \
62- ./Allwmake -tau -j 4; \
41+ ./Allwmake -au -j 4; \
6342 fi"
6443
65- # Copy binaries and libraries to system paths (as root)
66- USER root
67- RUN if [ -d "/home/$USER/OpenFOAM/$USER-openfoam2412/platforms/linux64GccDPInt32Opt/bin" ]; then \
68- cp -r /home/$USER/OpenFOAM/$USER-openfoam2412/platforms/linux64GccDPInt32Opt/bin/* /usr/local/bin/ || true; \
69- cp -r /home/$USER/OpenFOAM/$USER-openfoam2412/platforms/linux64GccDPInt32Opt/lib/* /usr/local/lib/ || true; \
70- fi
71-
72- # Final setup
73- USER $USER
74- WORKDIR $HOME
7544
7645# Source bashrc on container start
7746RUN /bin/bash -c "source /etc/bash.bashrc"
78-
7947ENTRYPOINT ["/bin/bash" ]
0 commit comments