apptainer pull docker://ghcr.io/apptainer/lolcow apptainer shell lolcow_latest.sif
singularity cache list -v singularity cache clean
~/.apptainer/cache缓存的位置
~/.apptainer/cache
$ echo "Hello from inside the container" > $HOME/hostfile.txt $ apptainer exec lolcow_latest.sif cat $HOME/hostfile.tx Hello from inside the container
This example works because hostfile.txt exists in the user’s home directory. By default Apptainer bind mounts /home/$USER, /tmp, and $PWD into your container at runtime.
$ echo "Drink milk (and never eat hamburgers)." > /data/cow_advice.txt $ apptainer exec --bind /data:/mnt lolcow_latest.sif cat /mnt/cow_advice.txt Drink milk (and never eat hamburgers).
cat /data/cow_advice.txt | apptainer exec lolcow_latest.sif cowsay
Pull an image from a URI
SynopsisThe ‘pull’ command allows you to download or build a container from a given URI. Supported URIs include:
library: Pull an image from the currently configured librarylibrary://user/collection/container[:tag]
docker: Pull a Docker/OCI image from Docker Hub, or another OCI registry.docker://user/image:tag
shub: Pull an image from Singularity Hubshub://user/image:tag
oras: Pull a SIF image from an OCI registry that supports ORAS.oras://registry/namespace/image:tag
http, https: Pull an image using the http(s?) protocolhttps://library.sylabs.io/v1/imagefile/library/default/alpine:latest
apptainer pull [pull options...] [output file]
Definition FilesEach bootstrap agent enables its own options and keywords. You can read about them and see examples in the appendix section
docker (images hosted on Docker Hub)oras (images from supporting OCI registries)library (images hosted on Library API Registries)scratch (a flexible option for building a container from scratch)
shub (images hosted on Singularity Hub)localimage (images saved on your machine)yum (yum based systems such as CentOS and Scientific Linux)debootstrap (apt based systems such as Debian and Ubuntu)oci (bundle compliant with OCI Image Specification)oci-archive (tar files obeying the OCI Image Layout Specification)docker-daemon (images managed by the locally running docker daemon)docker-archive (archived docker images)arch (Arch Linux)busybox (BusyBox)zypper (zypper based systems such as Suse and OpenSuse)