View Issue Details

IDProjectCategoryView StatusLast Update
0003741OpenFOAM[All Projects] Bugpublic2021-10-20 12:12
Reporterrasunag27Assigned To 
Status newResolutionopen 
PlatformLinuxOSUbuntuOS Version18.04
Product Version 
Fixed in Version 
Summary0003741: /bin/sh:1:icoFoam: not found error
DescriptionDear all,

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
FROM ubuntu:18.04

# Install any extra things we might need
RUN apt-get update \
    && apt-get install -y \
        vim \
        ssh \
        sudo \
        wget \
        software-properties-common ;\
        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 - | apt-key add -" ;\
    add-apt-repository ;\
    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
USER niramai
CMD icoFoam # Added additionally so as to execute from terminal
Steps To Reproducedocker build -t <name:tag> .
docker run -it <name:tag>
TagsNo tags attached.


There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-10-20 12:12 rasunag27 New Issue