Using docker inspect

After a build step has completed and the image has been placed into the cfcr registry how can I from within the pipeline use a standard docker inspect command to retrieve information about the built image ?

Hello

Using docker inspect requires direct access to the docker daemon socket. For security reasons this is not offered in SAAS plans (it is available to enterprise customers on a case by case basis)

You could use the codefresh CLI to get some basic image information.
https://codefresh-io.github.io/cli/images/

Would that work in your case? What kind of info do you need from the image? Can you explain a bit your scenario?

Hi,

I am wanting to inspect the Labels that were specified in the Docker file build. Here is an example where you can see the code fresh annotations added as labels followed by labels I wish to query.

       "Labels": {
            "io.codefresh.repo.branch": "feature/233_kustomize",
            "io.codefresh.repo.hash": "ad284fc5d7e8e431e7280c22f7a6c8e3cfb09c3e",
            "io.codefresh.repo.name": "studio-go-runner",
            "io.codefresh.repo.owner": "leaf-ai",
            "io.codefresh.repo.sha": "6b6a0ebde4bc6ae8d9e99592620220255f323779",
            "io.codefresh.repo.type": "yml",
            "registry.repo": "leafai/studio-go-runner-dev-base",
            "registry.version": "0.0.2",
            "vendor": "Cognizant, AI&A"
        }

Thanks
Karl

Could you use the Codefresh CLI then?

Codefresh CLI Documentation

There is already a docker image with the cli, so it is very easy to use it in a Codefresh pipeline

You might also find our annotations page interesting

When I do this it gives the following error. I have tried this using both the CLI remotely as well as within my call flow.

codefresh get annotation image 8074bb9c7a72
Error: "{\"status\":500,\"code\":\"1001\",\"name\":\"INTERNAL_SERVER_ERROR\",\"message\":\"Internal server error\",\"context\":{}}"

Moved discussion to a support ticket. Will update this thread when there is a result.

Interested to hear what you had to do

Still waiting on a reply to the support ticket from codefresh.

Update: This issue seems to have been fixed on November 25th. @karlmutch I saw that you had updated the ticket confirming the fix. Thank you.

@evanx9: Is this something you were running into and still need assistance with?

I didn’t need assistance but was curious about the solution since there has been some interest on how we can use the cli calls in this manner.