From 5d7afb5dca85abb2bbc1edecf0989871898b817f Mon Sep 17 00:00:00 2001
From: Branislav Jansik <branislav.jansik@vsb.cz>
Date: Tue, 3 Aug 2021 14:51:20 +0200
Subject: [PATCH] Update singularity.md

---
 docs.it4i/software/tools/singularity.md | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/docs.it4i/software/tools/singularity.md b/docs.it4i/software/tools/singularity.md
index 0c5439913..721b8369e 100644
--- a/docs.it4i/software/tools/singularity.md
+++ b/docs.it4i/software/tools/singularity.md
@@ -68,6 +68,31 @@ Singularity container built: ubuntu.img
 Cleaning up...
 ```
 
+alternatively, you can create your own docker image and import it to singularity.
+For example, we show how to create and run ubuntu docker image with gvim installed:
+
+```console
+your_local_machine $  docker pull ubuntu
+your_local_machine $  docker run --rm -it ubuntu bash
+# apt update
+# apt install vim-gtk
+your_local_machine $  docker ps -a
+your_local_machine $  docker commit 837a575cf8dc
+your_local_machine $  docker image  ls
+your_local_machine $  docker tag 4dd97cefde62 ubuntu_gvim
+your_local_machine $  docker save -o ubuntu_gvim.tar 4dd97cefde62 ubuntu_gvim
+```
+
+copy the `ubuntu_gvim.tar` archive to IT4I supercomputers, convert to Singularity image and run:
+
+```console
+$ ml Singularity
+$ singularity build ubuntu_givm.img docker-archive://ubuntu_gvim.tar
+$ singularity shell -B /usr/user/$ID ubuntu_gvim.img
+```
+
+Note the bind to `/usr/user/$ID` directory.
+
 ## Launching the Container
 
 The interactive shell can be invoked by the `singularity shell` command. This is useful for development purposes. Use the `-w | --writable` option to make changes inside the container permanent.
-- 
GitLab