Page History
The Buildah tool can build OCI container images directly on Eiger and Piz Daint. Buildah can only run in rootless mode on the systems: rootless mode relies on on Linux user namespaces, which are enabled on the compute nodes. Please refer to the official Buildah documentation for more information on the tool.The The command buildah
on Eiger is available directly on /usr/bin
, while on Piz Daint you need to load the module Buildah
as shown below, after you have accessed a compute node:
...
language | bash |
---|---|
theme | RDark |
...
Limitations
The gpfs
and lustre
file systems cannot store the image layers: In order to circumvent this problem, an ext4
partition is mounted on the compute node allocated using the contbuild
Slurm constraint.
Warning | ||
---|---|---|
| ||
After February 28th the buildah and stackinator tools on Eiger won't be available until further notice |
.
Using Buildah
The first step in order to use Buildah is to create a valid storage configuration file $HOME/.config/containers/storage.conf, following the minimal template provided below:
...
Code Block | ||||
---|---|---|---|---|
| ||||
srun -A <account> -C mc --pty bash # or "-C gpu" to access a GPU node on Piz Daint |
By default only one node is requested, since building container images is not supported with multiple nodes. On Piz Daint, you need to load the default module Buildah
:
...
language | bash |
---|---|
theme | RDark |
...
Then it is pretty straightforward to build an image from a Dockerfile using the following commands:
...
Interacting with container registries using Buildah for pulling or pushing container images is straightforward. Buildah uses a registries.conf configuration file which controls the interaction with container registries as well as a policy.json defining the trust policy for container images. Default registries.conf and policy.json files are provided on Piz Daint allowing to allow interaction with DockerHub. Custom configuration files can always be used via the --registries-conf and --signature-policy command line options.
...
For instance, in order to login interactively on your personal DockerHub registry where you are registered with <username>
, you should run the command below:
Code Block | ||||
---|---|---|---|---|
| ||||
buildah login docker.io/<username> |
...