Skip to content

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.

  • Copy tthe version you prefer with blue Copy button next to the corresponding tag. We will use latest as 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 pull and create a URL as docker://staphb/trimmomatic:latest
  • Then pull it with apptainer pull nameforthelocalimage.aif docker://staphb/trimmomatic:latest
    • nameforthelocalimage.aif is the name of the file to be saved once pulled. File extension can be anything but it is ideal to use .aif making it easier to idenity the container image

code

apptainer pull trimmomatic_0.40.aif docker://staphb/trimmomatic:latest
  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