View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003741||OpenFOAM||[All Projects] Bug||public||2021-10-20 12:12||2021-10-20 12:12|
|Fixed in Version|
|Summary||0003741: /bin/sh:1:icoFoam: not found error|
I have installed openfoam v5 from dockerfile with using ubuntu 18.04 as base image and used CMD command to check the execution of the software. The software command works perfectly from inside the container.
Firstly, I had used `RUN sh -c` command to install the software and also to source it as RUN sh -c 'echo "source /opt/openfoam5/etc/bashrc" >> ~/.bashrc' .
The CMD command inside dockerfile is `CMD icoFoam` .
Since, the error was showing /bin/sh:icoFoam not found after running Dockerfile, I gave the RUN command as described in this link:
RUN /bin/bash -c .
But, the error still persists as /bin/sh:1:icoFoam not found . Below is my dockerfile extracted from CFDEngine blog.
# Start from the official Ubuntu Bionic (18.04 LTS) image
# Install any extra things we might need
RUN apt-get update \
&& apt-get install -y \
rm -rf /var/lib/apt/lists/*
# Create a new user called foam
RUN useradd --user-group --create-home --shell /bin/bash niramai ;\
echo "niramai ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Install OpenFOAM v5 (without ParaView)
# including configuring for use by user=foam
# plus an extra environment variable to make OpenMPI play nice
RUN /bin/bash -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -" ;\
add-apt-repository http://dl.openfoam.org/ubuntu ;\
apt-get update ;\
apt-get install -y --no-install-recommends openfoam5 ;\
rm -rf /var/lib/apt/lists/* ;\
echo "source /opt/openfoam5/etc/bashrc" >> ~niramai/.bashrc ;\
echo "export OMPI_MCA_btl_vader_single_copy_mechanism=none" >> ~niramai/.bashrc
RUN chmod -R 777 /bin
# set the default container user to foam
CMD icoFoam # Added additionally so as to execute from terminal
|Steps To Reproduce||docker build -t <name:tag> .|
docker run -it <name:tag>
|Tags||No tags attached.|