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

Implementation of git repos in Docker

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2021, 11:44
Default Implementation of git repos in Docker
  #1
Member
 
Callum Guy
Join Date: Dec 2019
Location: Scotland
Posts: 44
Rep Power: 7
CallumG is on a distinguished road
Hi All,

I use a number of third party git repositories for my OpenFOAM projects which in the past I have compiled directly on the HPC. Because of the ever increasing number of these I thought it would be perhaps better to creater a docker image that has everything already built and then just start new containers everytime I want to run something on the HPC. Firstly, does anyone already do this and how do you find it?

Secondly could anyone offer some advice on the Dockerfile? I found the one from Robin over at CFD Engine (thanks Robin!):

Code:
FROM ubuntu:focal

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
	&& apt-get install -y vim curl git sudo

RUN useradd --user-group --create-home --shell /bin/bash foam ;\
	echo "foam ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

RUN curl -s https://dl.openfoam.com/add-debian-repo.sh | bash ;\
	apt-get install -y openfoam1912 openfoam1912-tutorials ;\
	rm -rf /var/lib/apt/lists/* ;\
	echo "source /usr/lib/openfoam/openfoam1912/etc/bashrc" >> ~foam/.bashrc ;\
	echo "export OMPI_MCA_btl_vader_single_copy_mechanism=none" >> ~foam/.bashrc

USER foam
if I wanted to clone a repo and then make it with the above how would I implement that? Something like:

Code:
FROM ubuntu:focal

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
	&& apt-get install -y vim curl git sudo

RUN useradd --user-group --create-home --shell /bin/bash foam ;\
	echo "foam ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

RUN curl -s https://dl.openfoam.com/add-debian-repo.sh | bash ;\
	apt-get install -y openfoam1912 openfoam1912-tutorials ;\
	rm -rf /var/lib/apt/lists/* ;\
	echo "source /usr/lib/openfoam/openfoam1912/etc/bashrc" >> ~foam/.bashrc ;\
	echo "export OMPI_MCA_btl_vader_single_copy_mechanism=none" >> ~foam/.bashrc ;\
	git clone <git-repository> ;\
	cd <git repository> ;\
	./allwmake

USER foam
Be interested to discuss how others implement this kind of thing.

All the best,
Callum
CallumG is offline   Reply With Quote

Reply


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
Ansys Installation on Docker Container mohsen.shiea ANSYS 11 March 14, 2024 12:18
OpenFoam in docker (gcc 6) vs. OpenFoam natively compiled (gcc 8.1.1) Anouk OpenFOAM Running, Solving & CFD 0 September 17, 2018 09:02
[OpenFOAM.com] Docker vs Not Docker v2 AND installing editors into Docker u2berggeist OpenFOAM Installation 1 July 10, 2018 03:58
[OpenFOAM.com] v1606+ Install pb with Docker on OSX El Capitan BPich OpenFOAM Installation 3 October 10, 2016 19:52
[OpenFOAM.org] A Mac OS X of23x Development Environment Using Docker rt08 OpenFOAM Installation 1 February 28, 2016 20:00


All times are GMT -4. The time now is 00:57.