GoogleContainerTools / container-structure-test

validate the structure of your container images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add flag to target optional docker repo

Techtesh opened this issue · comments

Can we add a feature/flag to target another (on prem/ personal mirror) docker hub
My very basic test.yaml:

`schemaVersion: 2.0.0
commandTests:

  • name: "cacheTest"
    command: "ls"
    args: ["/home/developer/.cache"]
    expectedOutput: ["2.2...txt"]`

Command run :
'docker run gcr.io/gcp-runtimes/container-structure-test:latest test --driver tar --image localhost/test-local:test --config /test.yaml'

is giving me the following error
Error: error creating driver: retrieving image: retrieving remote image: Get "https://index.docker.io/v2/": dial tcp: lookup index.docker.io on 10.0.2.3:53: no such host

Have you taken a look at registry-mirrors configuration on the Docker side? That should allow you to point to any arbitrary registry server (localhost or otherwise) to mirror Docker Hub image pulls.

I don't think cst is doing anything special in this regard for the image so I don't see how another flag would help. Whatever image gets resolved by the Docker driver/engine gets pass to cst to run your tests.