...
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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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
- Download latest Ubuntu image:
~/.local/bin/udocker pull ubuntu
- Verify available images:
~/.local/bin/udocker images
- Create a container:
~/.local/bin/udocker create --name=udocker-ubuntu ubuntu
- List running containers:
~/.local/bin/udocker ps
- Run an interactive shell:
~/.local/bin/udocker run udocker-ubuntu /bin/bash
- Check user:
whoami
- Check operating system:
cat /etc/os-release
- Exit from the container:
exit
- Delete the container:
~/.local/bin/udocker rm udocker-ubuntu