mounting sdb on /mnt using docker and openfoam

I recently found the post entitled “How to mount volumes in docker release of openFOAM” post on this site on October 2016. That post asks about automatically
mounting an already mounted (under bash or csh) volume through the Docker version of openfoam. Hopefully, this is explained below.

I have the situation that under csh, the output from lsblk is:

  • Find default network route IP address
  • docker commit mysql doesn't save
  • Docker non-root access: Error loading config file:stat /home/wu/.docker/config.json
  • using ansible for provisioning docker containers
  • Cannot run .exe (unsigned?) applications inside nanoserver
  • Rancher and elasticsearch Nest
  • NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sdb      8:16   0   1.8T  0 disk /mnt/hdd
    sda      8:0    0 111.8G  0 disk 
    ├─sda2   8:2    0     1K  0 part 
    ├─sda5   8:5    0   7.9G  0 part [SWAP]
    └─sda1   8:1    0 103.9G  0 part /
    

    Then I run the script startOpenFOAM+, which is the following Bash shell script:

    #!/bin/bash
    # this script will
    #   i) Start  OpenFOAM+ container with name 'of_v1612_plus'
    #  in the  the shell-terminal.
    #  User also need to run xhost+ from other terminal
    #  Note: Docker daemon should be running before launching script
    #  PostProcessing: User can launch paraview/paraFoam from terminal
    #  to postprocess the results
    #  Note: user can launch script in different  shell to have OpenFOAM
    #  working environment in different terminal
    xhost +local:of_v1612_plus
    docker start  of_v1612_plus
    docker exec -it of_v1612_plus /bin/bash -rcfile /opt/OpenFOAM/setImage_v1612+
    

    I am dumped into a Bash shell and the output from lsblk is now:

    bash-4.1$ lsblk
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sdb      8:16   0   1.8T  0 disk 
    sda      8:0    0 111.8G  0 disk 
    |-sda2   8:2    0     1K  0 part 
    |-sda5   8:5    0   7.9G  0 part [SWAP]
    `-sda1   8:1    0 103.9G  0 part /etc/sudoers.d
    

    I guess the answer to the problem is to add the line docker run -v .... into the startOpenFOAM+ shell script. However, I am not sure what to replace the dots with and where to place the command.

    Any help would be much appreciated.

    Thanks,

    Peter.

  • Docker container keeps growing
  • how to make fail2ban read json docker logs
  • “docker-machine rm” failing on non-existent EC2 instance
  • How to delete an inherit property from yaml config?
  • Sharing namespaces within Docker
  • Two containers - two Pythons - one site-packages?
  • One Solution collect form web for “mounting sdb on /mnt using docker and openfoam”

    If I understand, you need this:

    docker run -v /mnt/hdd:/mnt/hdd .....
    

    But you didn’t showed where you docker run, if you find it, then add that -v.

    Important: you will not see a mount point with lsblk inside container regarding sdb, because docker mount a directory, not a device. You just will see contents in /mnt/hdd

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.