#Docker registry: failed to resolve metadata for

1 messages · Page 1 of 1 (latest)

rapid lintel
#

Hi, I have an issue on Python Dagger SDK, I am currently trying to pull a Docker image from a private registry with authentication.

Here is the script:

@object_type
class OCI:
    DOCKER_IMAGE_NAME = "mydockerimage"

    def __init__(self, version: str) -> None:
        self.version: str = version

    @property
    def docker_image(self) -> str:
        return f"{HARBOR_REGISTRY}/{self.DOCKER_IMAGE_NAME}:{self.version}"

    def get_build_env(self) -> dagger.Container:
        return (
            dag.container()
                .from_(address=self.docker_image)
                .with_registry_auth(
                    address=HARBOR_REGISTRY,
                    username="my-username",
                    secret=dag.set_secret(name="harbor_token", plaintext="fjdklsqfjlksqokpa"),
                )
        )

I tried almost everything but everytime I got this output error:

  ✘ Container.from(address: "harbor.foobar-company.com/mydockerimage:1.0.19"): Container! 0.0s
  ! failed to resolve image harbor.foobar-company.com/mydockerimage:1.0.19: failed to resolve source metadata for harbor.foobar-company.com/mydockerimage:1.0.19: failed to do request: Head "https://harbor.foobar-company.com/v2/mydockerimage/manifests/1.0.19": notresolvable
    ✘ remotes.docker.resolver.HTTPRequest 0.0s
    ! notresolvable
      ✘ HTTP HEAD 0.0s
      ! notresolvable

Error: invalid selection for command "build": response from query: input: macifApiExample.build resolve: call function "build": process "/runtime" did not complete successfully: exit code: 1

I try to connect with the same auth on the url https://harbor.foobar-company.com/v2/mydockerimage/manifests/1.0.19 using Postman and got a 200 HTTP Status Code.

#

FYI I am using:

  • W11
  • Python 3.12.4
  • Dagger 0.12.1

I don't have docker installed on localhost, I am running Dagger Engine from another server.

bleak skiff
rapid lintel
#

Hi! i will try a simple curl to test if the endpoint is accessible and another curl command equivalent to the postman request

#

I keep you posted

rapid lintel
#

Effectively, it seems that the command curl -k https://harbor.foobar-company.com/api/v2.0/ping works well on local while on dagger engine I got curl: (56) CONNECT tunnel failed, response 502, I will check with the dagger engine server owner tomorrow.