Assuming that you can only use rootless Docker and that Docker is installed on the server machine:
- Ask IT to assign you sub-UIDs and sub-GIDs on the server.
- Run:
dockerd-rootless-setuptool.sh install - Some IMR servers uses NFS share for users HOME directory. Rootless Docker won't work with this. Find any physical disks (e.g.,
/localscratch) and run this command:rm -R ~/.local/share/docker mkdir -p /localscratch/${USER}/.local/share/docker ln -s /localscratch/${USER}/.local/share/docker ~/.local/share/docker
- Run Docker daemon at backend:
screen -dmS dockerd bash -c "export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock && dockerd-rootless.sh" - Test your docker installation:
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock docker run hello-world
- Prepare your local environment:
Note that the you only need to do the
echo 'export PATH=$HOME/local/bin:$PATH' >> $HOME/.bash_profile echo 'export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock' >> $HOME/.bash_profile source $HOME/.bash_profile
source...command once. The.bash_profilecontent will be executed on every user login. - Run the installation command:
Note that newer version might be available. You can check it here: https://docs.docker.com/compose/install/
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o ~/local/bin/docker-compose chmod +x ~/local/bin/docker-compose
- Check if Docker Compose is properly installed using this command:
docker-compose version
-
Clone
bioticexplorer-dockerrepo:git clone https://github.com/iambaim/bioticexplorer-docker.git -
Bring up the Bioticexplorer
cd bioticexplorer-docker docker-compose up -d
-
Setup user crontab for nightly database updates:
echo '0 0 * * * export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock && export PATH=/home/${USER}/local/bin:$PATH && export COMPOSE_INTERACTIVE_NO_CLI=1 && cd' $(pwd) '&& ./script/db-update.sh > '$(pwd)'/run.log 2>&1' > tmp-crontab crontab tmp-crontab
Note that the above assumes that we run the automated updates every 00:00 hour in the server time.
-
Populate database for the first time:
screen -dmS firstrun bash -c "export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock && ./script/db-update.sh" -
Sit back or relax while the database is being created for the first time. Or you can follow the progress by running:
screen -r firstrunDon't forget to do
Ctrl-a-dto detach from the screen. -
Meanwhile, the server should be reachable via the address
<server>:8080and<server>:8080/notebookfor the R Jupyter notebook server.
-
Ensure you have pushed all the necessary changes into the official BioticExplorer and BioticExplorerServer repositories (by default, the image will get them from https://github.com/MikkoVihtakari/BioticExplorer and https://github.com/MikkoVihtakari/BioticExplorerServer). See the
Dockerfilecontent. -
Note down your own Docker Hub repository that will host your image. Previously this was
iambaim/bioticexplorer(https://hub.docker.com/r/iambaim/bioticexplorer). You can use any name you want, just remember to update thedocker-compose.ymlfile to change the source location of the image. -
Build the image. TIPS: Building the image will take some time. Using
screenis a good idea:cd bioticexplorer-docker docker build -t mikkovihtakari/bioticexplorer:latest .
You can use any username/repository and version (e.g.,
mikkovihtakari/bioticexplorer:2.1). However, don't forget to to update thedocker-compose.ymlfile or just stick to usinglatestfor version. -
After the image building is complete, push the image to the Docker Hub (login first if you haven't done that):
docker login -u mikkovihtakari ... docker push mikkovihtakari/bioticexplorer:latest
-
Check your Docker Hub page to ensure that the image has been uploaded.
-
If you want to force the running server to use the latest image (again, don't forget to double check the
docker-compose.ymlfile content):cd bioticexplorer-docker docker-compose pull docker-compose up -d
-
If the server is misbehaving, you can restart it using:
cd bioticexplorer-docker docker-compose down ... docker-compose up -d
-
We can follow the server live logs using this command:
docker-compose logs -f -
To edit the live bioticexplorer server, use this command:
docker-compose exec -u root bioticexplorer bashAfter that you can go to
/BioticExplorerdirectory and edit the files usingvim. Use this in combination with the live logs to pinpoint any of the server errors. -
Sometimes the locally stored Docker image can get corrupted. Usually you'll getting this error:
...user XXXX not found...indocker-compose logsand/or thatdocker-compose psshows that a service is getting restarted all the time. The possible fix is as follows:# Shut down the services docker-compose down # First list all the images docker images # See the image that is used in the broken service, for example the 'monetdb' image. Delete the image docker rmi <IMAGE ID> # Asks docker-compose to pull all the images docker-compose pull # Sometimes the volume used by the service will get corrupted too. We need to delete the volume. docker volume ls # Let say the broken volume is 'bio_db_data' as that volume is used by the monetdb-based service. docker volume rm bio_db_data # Restart the service again. docker-compose up -d