CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.com] IcoFoam not found in docker when executed from outside

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By olesen

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 14, 2021, 09:29
Default IcoFoam not found in docker when executed from outside
  #1
Member
 
Sunag R A
Join Date: Jul 2019
Location: Bangalore, India
Posts: 82
Rep Power: 6
sunagra27 is on a distinguished road
Dear all,


I wanted to run OpenFOAM simulation inside docker container, for this I have built the docker image from dockerfile. The dockerfile has Openfoam 5 installation along with necessary requirements.


1. When the image is built, OpenFOAM works perfectly when I enter into the container and test with "icoFoam" command.


2. But, when I exec it with "CMD" inside dockerfile, it throws an error stating "icoFoam not found".


3. All installation done with new user and not in root.


Below is the dockerfile content.


Code:
###################################################################################

   

USER root

# Install OpenFOAM5.0, paraviewopenfoam54 and PyFoam
 # Add dl.openfoam.org to the list of software repositories


 RUN sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -"


 # Install the dependancies (Can also have a requirements file and build from there)


 RUN apt-get install software-properties-common -y
RUN add-apt-repository http://dl.openfoam.org/ubuntu
RUN apt-get install apt-transport-https -y
 
RUN apt-get update -y
 
RUN apt-get -y install openfoam5


# New user creation
RUN groupadd -r sunag && useradd -m -r -g sunag sunag

# Source bashrc
RUN echo "source /opt/openfoam5/etc/bashrc" >> /home/sunag/.bashrc

USER sunag

# Install pip packages for specific user
RUN python -m pip install --user numpy scipy pandas scikit-image opencv-python PyFoam open3d numpy-stl gunicorn


WORKDIR /home
CMD icoFoam
4. The CMD command when docker image is run, throws "icoFoam not found", but when the entering the container and running icoFoam, it works perfectly.


So, what am I missing here or what work around needs to be done?


Hope, it is understood.


Regards,
Sunag R A.
sunagra27 is offline   Reply With Quote

 

Tags
cmd, docker, openfoam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[RapidCFD] Discussion thread on how to install and use RapidCFD newoscar OpenFOAM Community Contributions 88 May 17, 2024 09:39
error in fireFoam, when running the case wallFireSpread2D zhoubiao1088 OpenFOAM Running, Solving & CFD 9 February 1, 2018 18:45
[Other] Compiling hacFoam (Ubuntu 10.04)(OF2.0.0)(LAMMPS13Jul2010)) Henrik_E OpenFOAM Installation 3 September 29, 2016 16:16
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 flakid OpenFOAM Installation 16 December 28, 2010 08:48
critical error during installation of openfoam Fabio88 OpenFOAM Installation 21 June 2, 2010 03:01


All times are GMT -4. The time now is 13:04.