|
[Sponsors] |
January 22, 2016, 11:50 |
[3.0+] problems with docker
|
#1 |
New Member
Join Date: Apr 2009
Posts: 6
Rep Power: 17 |
Since about a week we now need to install docker in order to get a proper installation of OpenFOAM.
However, while OpenFOAM seems to run pretty smoothly, I have minor problems with docker with which I am very unfamiliar. First of all, everytime I run it, it unsets the variable $USER, which is pretty bad since OpenFOAM uses it to create folders. Example: OpenFOAM tutorials create the folder "$USER-$VERSION" and for me the folder created is named "-v3.0+", which is a terrible name since it doesn't begin with a letter. Also, I don't have any alias anymore. While I understand the need for a unified environment, I would like a convenient and thus automatic sourcing of say a ".alias" file. Is there a way to do that while calling the docker script? Of course, putting "source /home/username/.alias" at the end of the "startOpenFoam+" script doesn't work... If anybody has idea, thanks in advance. |
|
January 25, 2016, 04:47 |
|
#2 |
Senior Member
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10 |
Hi Vanadyel ,
You need to pass $USER variable inside the container environment. You can proceed as follow : 1) If you have not changed the source code in installation i.e /Opt/OpenFOAM or does not worry about any change that you made . Then you can delete the container by typing this command : docker rm -f of_v3.0_plus 2)Then open the installation script and add this variable i.e -e USER=${user} in command line which read as below docker run -it -d --name ${containerName} --user=${user} -e USER=${user} ...... ................................ ${imageName} /bin/bash --rcfile /opt/OpenFOAM/OpenFOAM-v3.0+/etc/bashrc 3)run installation script again . Go inside the container by launching startContainer.sh and then run "echo $USER " in terminal to see environment variable is coming as desired It should solve the issue . Note: Any changes done in /opt/OpenFOAM/... in container is local to it . I.e suppose if you by mistake delete the OpenFOAM source folder . then this change is only local to this container. You can delete that container and again launch installation script to create a new environment . |
|
January 25, 2016, 08:44 |
|
#3 |
New Member
Join Date: Apr 2009
Posts: 6
Rep Power: 17 |
Thank you very much pgh, this works.
I also added my .alias file at the end of the /opt/OpenFOAM/OpenFOAM-v3.0+/etc/bashrc file to solve my second minor problem. |
|
January 25, 2016, 15:20 |
|
#4 |
Senior Member
Pawan Ghildiyal
Join Date: Nov 2015
Posts: 135
Rep Power: 10 |
Good. Also note that this change is only for container with name of_v3.0_plus I,e when you change bashrc script , it is local to container environment . If you create new container with new name or create new container after deleting old one , this change will not reflect there.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] Problems with coedge curves and surfaces | tommymoose | ANSYS Meshing & Geometry | 6 | December 1, 2020 11:12 |
[Other] Multiple users using same docker? | Void | OpenFOAM Installation | 2 | June 13, 2018 13:43 |
[OpenFOAM.com] v1712 with Docker on Ubuntu 17.10. Use same docker in Windows 10? | amh@inventas.no | OpenFOAM Installation | 0 | January 30, 2018 08:59 |
[Other] Installation of OpenFOAM: Docker or not Docker? | zt49 | OpenFOAM Installation | 2 | December 22, 2016 10:38 |
[OpenFOAM.com] v1606+ Install pb with Docker on OSX El Capitan | BPich | OpenFOAM Installation | 3 | October 10, 2016 18:52 |