Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

uDocker was created in H2020 project INDIGO-DataCloud. It uses Docker images natively, but provides a userspace tool to run and manage containers. Because it does not require superuser privileges, it is also a good fit as a container tool to be used in HPCs. uDocker also supports MPI calculations and provides ways to access host's GPU. 

Availability

uDocker is contained in a single Python file making it easy to deploy in distributed systems. To install it on Gateway execute:

Code Block
languagebash
setenv WORK /pfs/work/$USER
setenv SCRATCH /pfs/scratch/$USER

mkdir -p ~/.local/bin ${WORK}/dot-udocker ${SCRATCH}
ln -s ${WORK}/dot-udocker ~/.udocker
curl https://raw.githubusercontent.com/indigo-dc/udocker/master/udocker.py > ~/.local/bin/udocker
chmod u+rx ~/.local/bin/udocker
echo "tmpdir='${SCRATCH}'" > ~/.udocker/udocker.conf
~/.local/bin/udocker install


Info
titleuDocker on other machines

The same steps can be repeated on other machines, including HPC or your local computer. Just change WORK and SCRATCH variables in the first two lines. Note, that SCRATCH will be used during import of new images and WORK will be used to store images and files on all running containers. Choose them wisely to accommodate possibly big amount of data.


Exercises

Start uDocker container

  1. Download latest Ubuntu image: ~/.local/bin/udocker pull ubuntu
  2. Verify available images: ~/.local/bin/udocker images
  3. Create a container: ~/.local/bin/udocker create --name=udocker-ubuntu ubuntu
  4. List running containers: ~/.local/bin/udocker ps
  5. Run an interactive shell: ~/.local/bin/udocker run udocker-ubuntu /bin/bash
  6. Check user: whoami
  7. Check operating system: cat /etc/os-release
  8. Exit from the container: exit
  9. Delete the container: ~/.local/bin/udocker rm udocker-ubuntu

IMAS image