From 8703358587d9dadc112b6f06b0de23e6f992d7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Fei?= Date: Thu, 5 Feb 2026 18:21:24 +0100 Subject: [PATCH 1/2] fix: local registry on a custom port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Niccolò Fei --- BUILD.md | 5 +++++ Taskfile.yml | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/BUILD.md b/BUILD.md index b430037..1439349 100644 --- a/BUILD.md +++ b/BUILD.md @@ -167,6 +167,11 @@ registry (available at `localhost:5000`). task e2e:setup-env ``` +> [!INFO] +> You can customize the local registry's port using the `REGISTRY_HOST_PORT` variable. +> If you setup the environment with a custom `REGISTRY_HOST_PORT`, take care to include +> this variable when running tasks that interact with the local registry. + ### Get access to the cluster To interact with the cluster via `kubectl` from your local terminal: diff --git a/Taskfile.yml b/Taskfile.yml index fbb9b4b..d2b5af7 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -11,7 +11,9 @@ vars: E2E_NETWORK: pg-extensions-e2e DAGGER_ENGINE_NAME: dagger-engine-pg-extensions REGISTRY_NAME: registry.pg-extensions + REGISTRY_HOST_IP: localhost REGISTRY_HOST_PORT: 5000 + REGISTRY_INTERNAL_PORT: 5000 # renovate: datasource=git-refs depName=kind lookupName=https://github.com/aweris/daggerverse currentValue=main DAGGER_KIND_SHA: dadbc09a1e0790ccbf1d88f796308b26a12f0488 # renovate: datasource=docker depName=kindest/node versioning=docker @@ -72,6 +74,8 @@ tasks: - prereqs prefix: 'bake-{{.TARGET}}' silent: true + env: + registry: '{{ .REGISTRY_HOST_IP }}:{{ .REGISTRY_HOST_PORT }}' vars: PUSH: '{{.PUSH | default "false"}}' DRY_RUN: '{{.DRY_RUN | default "false"}}' @@ -181,7 +185,7 @@ tasks: REGISTRY_VERSION: 3.0.0@sha256:6c5666b861f3505b116bb9aa9b25175e71210414bd010d92035ff64018f9457e cmds: - > - docker run -d --name {{ .REGISTRY_NAME }} --rm -p {{ .REGISTRY_HOST_PORT }}:5000 + docker run -d --name {{ .REGISTRY_NAME }} --rm -p {{ .REGISTRY_HOST_PORT }}:{{ .REGISTRY_INTERNAL_PORT }} --network {{ .E2E_NETWORK }} registry:{{ .REGISTRY_VERSION }} status: - test "$(docker inspect -f {{`'{{json .State.Running}}'`}} {{ .REGISTRY_NAME }})" == "true" @@ -210,7 +214,7 @@ tasks: internal: true run: once vars: - REGISTRY_DIR: /etc/containerd/certs.d/{{ .REGISTRY_NAME }}:{{ .REGISTRY_HOST_PORT }} + REGISTRY_DIR: /etc/containerd/certs.d/{{ .REGISTRY_NAME }}:{{ .REGISTRY_INTERNAL_PORT }} DOCKER_SOCKET: sh: docker context inspect -f {{`'{{json .Endpoints.docker.Host}}'`}} $(docker context show) env: @@ -224,7 +228,7 @@ tasks: - docker exec "{{ .KIND_CLUSTER_NAME }}-control-plane" mkdir -p "{{ .REGISTRY_DIR }}" - | cat < @@ -327,7 +331,7 @@ tasks: EXTENSION_IMAGE: # We need to replace localhost with the registry container name as it is how # the registry is reachable from within the Docker network. - sh: sed -E 's/^localhost/{{ .REGISTRY_NAME }}/;t' <<< "{{ .EXTENSION_IMAGE }}" + sh: sed -E 's/^{{ .REGISTRY_HOST_IP }}:{{ .REGISTRY_HOST_PORT }}/{{ .REGISTRY_NAME }}:{{ .REGISTRY_INTERNAL_PORT }}/;t' <<< "{{ .EXTENSION_IMAGE }}" requires: vars: - name: TARGET From c3b9867e21e2259869a8b5e9e5a12d6f671a5047 Mon Sep 17 00:00:00 2001 From: Gabriele Bartolini Date: Fri, 6 Feb 2026 11:19:39 +1100 Subject: [PATCH 2/2] docs: review Signed-off-by: Gabriele Bartolini --- BUILD.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/BUILD.md b/BUILD.md index 1439349..7177c9a 100644 --- a/BUILD.md +++ b/BUILD.md @@ -168,9 +168,9 @@ task e2e:setup-env ``` > [!INFO] -> You can customize the local registry's port using the `REGISTRY_HOST_PORT` variable. -> If you setup the environment with a custom `REGISTRY_HOST_PORT`, take care to include -> this variable when running tasks that interact with the local registry. +> Use the `REGISTRY_HOST_PORT` variable to customize the local registry port. +> If changed, you must pass this variable to all subsequent tasks that interact +> with the registry to ensure connectivity. ### Get access to the cluster @@ -182,9 +182,10 @@ export KUBECONFIG=$PWD/kubeconfig ``` > [!IMPORTANT] -> The local registry running alongside the Kind cluster is reachable within -> Kubernetes at `registry.extensions:5000`. When testing your local builds, you -> must point the extension's `reference` to this internal address. +> By default, the local registry running alongside the Kind cluster is +> reachable within Kubernetes at `registry.extensions:5000`. When testing your +> local builds, you must point the extension's `reference` to this internal +> address. > For example, if you are testing a locally built `pgvector` image, use: > `reference: registry.extensions:5000/pgvector-testing:`