Search code examples
dockersecuritydocker-containertrivy

Can you download a docker image from a repository to a docker container without a running docker daemon?


I have a docker container with Trivy installed.
I have a remote registry with docker images.

and

I would like to download the docker images to the container for scanning

Challenges

It is hard to run docker within a docker container for pulling the images. Trivy requires that you have the images locally before it can scan the images, either in a local registry or as a file.


Solution

  • I found two solutions:

    1. Download the images with Skopeo
    2. Download the images with the HTTP API V2
      • For the API I had a hard time making the authentication work, as it is repository specific, and Scaleways' authentication had unexpected behaviour.