Skip to content

Cannot download docker image from Gitlab Container Registry #3520

Open
@position-imaging-josh

Description

@position-imaging-josh

Before you report an issue...

Only issues that can be replicated on the latest release, or development branch, of SingularityCE will be investigated and fixed. The open source project does not maintain long-term stable branches or fix bugs in prior versions. If you require LTS support then please see the Sylabs website.

Version of Singularity

4.1.1 and 4.2.2

Describe the bug

After authenticating with gitlab using the following command:

singularity registry login --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD docker://$CI_REGISTRY

Singularity cannot download the image, reporting the following error:

singularity --debug build --force --authfile ./docker-config.json image.sif newimage.def
DEBUG   [U=0,P=438]        persistentPreRun()            Singularity version: 4.2.2
DEBUG   [U=0,P=438]        persistentPreRun()            Parsing configuration file /usr/local/etc/singularity/singularity.conf
DEBUG   [U=0,P=438]        maybeReExec()                 Checking whether to re-exec
DEBUG   [U=0,P=438]        handleConfDir()               /root/.singularity already exists. Not creating.
DEBUG   [U=0,P=438]        handleRemoteConf()            Ensuring file permission of 0600 on /root/.singularity/remote.yaml
DEBUG   [U=0,P=438]        Init()                        Image format detection
DEBUG   [U=0,P=438]        Init()                        Check for sandbox image format
DEBUG   [U=0,P=438]        Init()                        sandbox format initializer returned: not a directory image
DEBUG   [U=0,P=438]        Init()                        Check for sif image format
DEBUG   [U=0,P=438]        Init()                        sif format initializer returned: SIF magic not found
DEBUG   [U=0,P=438]        Init()                        Check for ocisif image format
DEBUG   [U=0,P=438]        Init()                        ocisif format initializer returned: SIF magic not found
DEBUG   [U=0,P=438]        Init()                        Check for squashfs image format
DEBUG   [U=0,P=438]        Init()                        squashfs format initializer returned: while parsing squashfs super block: not a valid squashfs image
DEBUG   [U=0,P=438]        Init()                        Check for ext3 image format
DEBUG   [U=0,P=438]        Init()                        ext3 format initializer returned: file is not a valid ext3 image
DEBUG   [U=0,P=438]        getCacheParentDir()           environment variable SINGULARITY_CACHEDIR not set, using default image cache
DEBUG   [U=0,P=438]        initCacheDir()                Creating cache directory: /root/.singularity/cache
DEBUG   [U=0,P=438]        initCacheDir()                Creating cache directory: /root/.singularity/cache/library
DEBUG   [U=0,P=438]        initCacheDir()                Creating cache directory: /root/.singularity/cache/oci-tmp
DEBUG   [U=0,P=438]        initCacheDir()                Creating cache directory: /root/.singularity/cache/shub
DEBUG   [U=0,P=438]        initCacheDir()                Creating cache directory: /root/.singularity/cache/oras
DEBUG   [U=0,P=438]        initCacheDir()                Creating cache directory: /root/.singularity/cache/net
DEBUG   [U=0,P=438]        initCacheDir()                Creating cache directory: /root/.singularity/cache/oci-sif
DEBUG   [U=0,P=438]        initCacheDir()                Creating cache directory: /root/.singularity/cache/blob
DEBUG   [U=0,P=438]        initLayout()                  Creating cache OCI layout: /root/.singularity/cache/blob
DEBUG   [U=0,P=438]        Init()                        Image format detection
DEBUG   [U=0,P=438]        Init()                        Check for sandbox image format
DEBUG   [U=0,P=438]        Init()                        sandbox format initializer returned: not a directory image
DEBUG   [U=0,P=438]        Init()                        Check for sif image format
DEBUG   [U=0,P=438]        Init()                        sif format initializer returned: SIF magic not found
DEBUG   [U=0,P=438]        Init()                        Check for ocisif image format
DEBUG   [U=0,P=438]        Init()                        ocisif format initializer returned: SIF magic not found
DEBUG   [U=0,P=438]        Init()                        Check for squashfs image format
DEBUG   [U=0,P=438]        Init()                        squashfs format initializer returned: while parsing squashfs super block: not a valid squashfs image
DEBUG   [U=0,P=438]        Init()                        Check for ext3 image format
DEBUG   [U=0,P=438]        Init()                        ext3 format initializer returned: file is not a valid ext3 image
DEBUG   [U=0,P=438]        newBundle()                   Created temporary directory "/tmp/bundle-temp-17565198" for the bundle
DEBUG   [U=0,P=438]        newBundle()                   Created directory "/tmp/build-temp-824336296/rootfs" for the bundle
INFO    [U=0,P=438]        Full()                        Starting build...
INFO    [U=0,P=438]        Get()                         Fetching OCI image...
DEBUG   [U=0,P=438]        cleanUp()                     Cleaning up "/tmp/build-temp-824336296/rootfs" and "/tmp/bundle-temp-17565198"
FATAL   [U=0,P=438]        runBuildLocal()               While performing build: conveyor failed to get: GET https://gitlab.com/jwt/auth?scope=repository%3Api-spr%2Fkiwi%2Fncs%2Fbuildenvironmentncs%2Fenginerelease3-arm64%3Apull&service=container_registry: DENIED: access forbidden

To Reproduce

  1. Setup Docker image on Gitlab
  2. Setup singularity to use it

Expected behavior

It would be able to pull docker images from Gitlab

OS / Linux Distribution

Its running in a virtualized AMR64 environment in Docker on a privileged Ubuntu 24.04 image, on a privileged LXC container running Ubuntu 24.04, on Proxmox 8.3.3 which is Debian

Installation Method

Originally I tried it from the Ubuntu 24.04 repository but it had 4.1.1. I compiled the lated 4.2.2 just to check but saw the same issue.

Additional context

I tried to make sure the image should be available from gitlab using their access settings. I am opening a ticket with them as well to see if it something on their end.

Thank you for your time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions