4. How to pull a container image from an upstream registry such as Docker hub¶
Docker containers ( primarily stored in https://hub.docker.com/) can be pulled as Apptainer container images. For an example, if we want to pull the latest version of Tensorflow (GPU) container provided by the Tensorflow developers
-
Search and find the container registry for Trimmomatic in https://hub.docker/com.
- image we are after in this instance is https://hub.docker.com/r/staphb/trimmomatic/tags
-
Copy tthe version you prefer with blue Copy button next to the corresponding tag. We will use
latestas an example- It will be in the form of
docker pull staphb/trimmomatic:latest - IN order to pull this as an apptainer, remove the word
pulland create a URL asdocker://staphb/trimmomatic:latest
- It will be in the form of
- Then pull it with
apptainer pull nameforthelocalimage.aif docker://staphb/trimmomatic:latestnameforthelocalimage.aifis the name of the file to be saved once pulled. File extension can be anything but it is ideal to use.aifmaking it easier to idenity the container image
code
❯ apptainer pull trimmomatic_0.40.aif docker://staphb/trimmomatic:latest
INFO: Converting OCI blobs to SIF format
INFO: Starting build...
INFO: Fetching OCI image...
28.2MiB / 28.2MiB [======================================================================================================================================================================================================================================] 100 % 17.0 MiB/s 0s
179.6KiB / 179.6KiB [====================================================================================================================================================================================================================================] 100 % 17.0 MiB/s 0s
72.0MiB / 72.0MiB [======================================================================================================================================================================================================================================] 100 % 17.0 MiB/s 0s
INFO: Extracting OCI image...
INFO: Inserting Apptainer configuration...
INFO: Creating SIF file...
[===================================================================================================================================================================================================================================================================] 100 % 0s