3

It appears the default K3D registry commands are broken.

k3d registry create test-registry.localhost --port 23456
k3d cluster create test-cluster --registry-use k3d-test-registry.localhost:23456
docker tag nginx:latest my-cluster.localhost:12347/mynginx:v0.1
docker push k3d-test-registry.localhost:23456/mynginx:v0.1

Fails with:

The push refers to repository [k3d-test-registry.localhost:23456/mynginx]
Get "https://k3d-test-registry.localhost:23456/v2/": dialing k3d-test-registry.localhost:23456 with direct connection: resolving host k3d-test-registry.localhost: lookup k3d-test-registry.localhost: no such host

The expected behavior is that the host is aliased to localhost:23456 and can handle the pushed image. A better experience if that can't happen is that there is an error when trying to create the registry or mapping the host.

System:

  • Mac (M1)
  • Docker version 20.10.23, build 7155243
user3162553
  • 2,699
  • 3
  • 37
  • 61

1 Answers1

0

Just ran into this playing with k3d

On Mac: Sudo edit your /etc/hosts file and add this entry for the name of your registry cluster name:

127.0.0.1 k3d-test-registry

and save that file, then try to push to it again

Step 2 from: https://k3d.io/v5.1.0/usage/registries/#preface-referencing-local-registries

kspyy
  • 51
  • 1
  • 9