I'm having some difficulties writing what I'd hoped to be a simple test module. I'm trying to stage an ephemeral Docker registry, so that I can build a container and push it to that registry. Ultimately, so I can then test my Cosign module against it.
This part of the test module:
reg, err := dag.Container().
From("registry:2.8.3").
WithExposedPort(5000).
AsService().
Start(ctx)
if err != nil {
return fmt.Errorf("failed to start registry: %w", err)
}
testRef, err := dag.Container().From("alpine:latest").
WithServiceBinding("registry", reg).
Publish(ctx, "registry:5000/test")
if err != nil {
return fmt.Errorf("failed to publish image: %w", err)
}
Creates this output:
✘ Tests.all: Void 2.4s
! call function "All": process "/runtime" did not complete successfully: exit code: 2
┃ invoke: failed to publish image: input: container.from.withServiceBinding.publish resolve: failed to export: failed to push registry:5000/test: failed to do request: Head "https://registry:5
┃ 0/v2/test/blobs/sha256:d25f557d7f31bf7acfac935859b5153da41d13c41f2b468d16f729a5b883634f": dial tcp: lookup registry on 10.87.0.1:53: no such host
┃
✔ Service.start: ServiceID! 0.2s
✔ start /entrypoint.sh /etc/docker/registry/config.yml 0.7s
┃ d36db80e3 service=registry version=2.8.3
--snip--
┃ 17:28:27 INF port is healthy endpoint=10.87.0.19:5000
✔ Container.from(address: "alpine:latest"): Container! 0.1s
✘ Container.publish(address: "registry:5000/test"): String! 0.0s
! failed to export: failed to push registry:5000/test: failed to do request: Head "https://registry:5000/v2/test/blobs/sha256:d25f557d7f31bf7acfac935859b5153da41d13c41f2b468d16f729a5b883634f": dial tcp: lookup registry on 10.87.0.1:53: no such host
✘ remotes.docker.resolver.HTTPRequest 0.0s
! dial tcp: lookup registry on 10.87.0.1:53: no such host
✘ HTTP HEAD 0.0s
! dial tcp: lookup registry on 10.87.0.1:53: no such host
✘ remotes.docker.resolver.HTTPRequest 0.0s
! dial tcp: lookup registry on 10.87.0.1:53: no such host
✘ HTTP HEAD 0.0s
! dial tcp: lookup registry on 10.87.0.1:53: no such host
Error: response from query: input: tests.all resolve: call function "All": process "/runtime" did not complete successfully: exit code: 2
Stdout:
invoke: failed to publish image: input: container.from.withServiceBinding.publish resolve: failed to export: failed to push registry:5000/test: failed to do request: Head "https://registry:5000/v2/test/blobs/sha256:d25f557d7f31bf7acfac935859b5153da41d13c41f2b468d16f729a5b883634f": dial tcp: lookup registry on 10.87.0.1:53: no such host
I feel like I'm missing something very simple. Any ideas?