-
Notifications
You must be signed in to change notification settings - Fork 117
Docker tutorial
Sasha Baranov edited this page Oct 14, 2015
·
3 revisions
First you need a docker installed:
- OS X or Windows: you can use Docker Toolbox. Also, check version of Virtualbox installed with Docker Toolbox. It should be 5.0.5 or greater. You can download fresh version here
-
Linux:
googleYandex "install docker %MY_DISTRO%"
Second, you need to do something like this:
# <If you use OS X>
docker-machine create --driver virtualbox ship
eval "$(docker-machine env ship)" # should be done each time you use docker. Put this in .bash_profile
# </If you use OS X>
# Create your workdir
mkdir my-workdir
cd my-workdir
# Create git repo and get FairShip:
git init
git submodule add https://github.com/ShipSoft/FairShip.git
git commit -m "Initially add FairShip"
# Create docker container with workdir mounted (will take some time to download first time)
docker run -ti -v `pwd`:/input anaderi/fairroot:latest
Now you have your container started and you are working inside it. (Prompt changes to bash-4.1#
).
Build FairShip:
export FAIRSHIP=/input/FairShip
export PYTHONPATH=/input/FairShip/python:$PYTHONPATH
mkdir /output # store your output there
mkdir /input/FairShipRun
cd /input/FairShipRun/
cmake ../FairShip
make
source config.sh
Now you can work in my-workdir
, change files in FairShipRun
and commit them to git:
# ...Make some changes...
# (outside container)
git add FairShipRun
git commit -m "Updated FairShipRun"
Important: all files generated by your code(.root and other) should be stored in /output
.
You'll need to create repository on github for your code and push your changes there:
# (outside container)
git remote add origin git@github.com:YOUR_USERNAME/YOUR_REPO.git
git push -u origin master
After you tested your code inside container, you can mail us
- Your repository
- Commandline to execute your code
If you have any questions you can also ask them on this mailing list.