Adding docker build & push to CI
Motivation
Gitlab offers now its own registry system. So we can automatically build the new official topfarm docker environment each time we do a merge. This allows everyone to have quickly access to a reference implementation that can be pulled from the main registry. The tests and documentation build could be run into this official docker container system as well.
Main commands
building
docker build -t registry.windenergy.dtu.dk/topfarm/topfarm2:latest -f docker/Dockerfile .
Pushing
docker push registry.windenergy.dtu.dk/topfarm/topfarm2:latest
Pulling
docker pull registry.windenergy.dtu.dk/topfarm/topfarm2:latest
Running the docker container
docker run -it registry.windenergy.dtu.dk/topfarm/topfarm2:latest bash
Running a notebook
docker run \
-p 8898:8898 \
-v $(pwd):/topfarm/local \
--name topfarm_notebook \
-d \
registry.windenergy.dtu.dk/topfarm/topfarm2:latest \
jupyter notebook \
--notebook-dir=/topfarm \
--allow-root \
--port=8898 \
--ip='*'
(Note that $(pwd)
should be replaced by the location of your topfarm main directory under non unix system)
Stopping the notebook
docker stop topfarm_notebook
Getting the token for accessing the notebook
docker logs