View Issue Details

IDProjectCategoryView StatusLast Update
0003741OpenFOAMBugpublic2021-12-21 10:28
Reporterrasunag27 Assigned Tochris  
PriorityurgentSeverityminorReproducibilityN/A
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version18.04
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:
https://superuser.com/questions/1634933/bin-sh-1-my-command-not-found

as,

RUN /bin/bash -c .

But, the error still persists as /bin/sh:1:icoFoam not found . Below is my dockerfile extracted from CFDEngine blog.

Dockerfile:

# 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 - 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
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.

Activities

chris

2021-12-21 10:28

manager   ~0012339

We - The OpenFOAM Foundation - have our own Docker build for OpenFOAM v5 described here:
https://openfoam.org/download/5-0-linux/

Your issue is not related to any instructions we provide.

Issue History

Date Modified Username Field Change
2021-10-20 12:12 rasunag27 New Issue
2021-12-21 10:28 chris Note Added: 0012339
2021-12-21 10:28 chris Assigned To => chris
2021-12-21 10:28 chris Status new => closed
2021-12-21 10:28 chris Resolution open => fixed