Skip to content

Conversation

@CorentinRegnier
Copy link

@CorentinRegnier CorentinRegnier commented Aug 4, 2025

Summary

This pull request fixes a runtime issue in the GoReleaser.Dockerfile that affects the prometheus_varnish_exporter binary. While the image builds successfully, the exporter fails to run due to an invalid symlink.

Problem

The Dockerfile attempts to create a symlink to prometheus_varnish_exporter after extracting the archive:

ln -sf /exporter/prometheus_varnish_exporter-<version>/prometheus_varnish_exporter prometheus_varnish_exporter

However, this symlink points to a path that no longer exists at runtime, because the extracted directory is not preserved or included properly in the final image layer. As a result, the binary at /exporter/prometheus_varnish_exporter is broken.

This causes container startup to fail when the exporter is invoked.

Screenshot / Error output

Click to expand runtime error
❯ docker run --rm -it --entrypoint="" quay.io/mittwald/kube-httpcache:v0.9.1 bash
root@80cb0973941c:/# ls -al /exporter/
total 32
drwxr-xr-x 1 varnish root 4096 Jul 15 13:12 .
drwxr-xr-x 1 root    root 4096 Aug  4 09:46 ..
-rw-r--r-- 1    1001  118 5464 Jul 15 12:55 CHANGELOG.md
-rw-r--r-- 1    1001  118 1078 Jul 15 12:55 LICENSE
-rw-r--r-- 1    1001  118 5705 Jul 15 12:55 README.md
lrwxrwxrwx 1 root    root   84 Jul 15 13:12 prometheus_varnish_exporter -> /exporter/prometheus_varnish_exporter-v1.7.0.linux-amd64/prometheus_varnish_exporter
root@80cb0973941c:/# ls ^C
root@80cb0973941c:/# /exporter/prometheus_varnish_exporter
bash: /exporter/prometheus_varnish_exporter: No such file or directory
root@80cb0973941c:/# /exporter/prometheus_varnish_exporter-v1.7.0.linux-amd64/prometheus_varnish_exporter
bash: /exporter/prometheus_varnish_exporter-v1.7.0.linux-amd64/prometheus_varnish_exporter: No such file or directory
root@80cb0973941c:/# ls -al /tmp/
total 3404
drwxrwxrwt 1 root    root       4096 Jul 15 13:12 .
drwxr-xr-x 1 root    root       4096 Aug  4 09:46 ..
-rw------- 1 varnish varnish 3474239 Jul 15 12:58 prometheus_varnish_exporter-v1.7.0.linux-amd64.tar.gz
root@80cb0973941c:/#

On kubernetes Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/exporter/prometheus_varnish_exporter": stat /exporter/prometheus_varnish_exporter: no such file or directory: unknown

Regression context

This issue was introduced starting from version v0.9.1, when the Prometheus exporter was switched to prometheus_varnish_exporter. The problem is still present on the current master branch.

As of these versions, the image includes a broken symlink for the exporter binary, making the container unusable in runtime contexts like AKS or Helm-based deployments.

What changed

  • Removed the unnecessary and broken ln -sf step
  • Deleted the archive after extraction for cleanliness

The binary is already placed in the expected location during extraction, so no symlink is required.

How I tested

I built the Docker image with the fix and pushed it to my own container registry:

docker build -t my-registry.example.com/kube-httpcache:dev -f build/package/docker/GoReleaser.Dockerfile .
docker push my-registry.example.com/kube-httpcache:dev

I then deployed it on a real Kubernetes cluster (AKS) by updating the image reference in the Helm values to point to my custom image.

✅ With this fix, the prometheus_varnish_exporter binary runs correctly and the pod starts successfully.
❌ Without the fix, the exporter binary fails to execute due to a broken symlink, preventing proper startup.

Why it matters

Without this fix, the Docker image produces a broken runtime due to a missing binary, even though the build succeeds. This breaks local testing and deployment workflows — particularly those relying on KinD or Helm installs using the built image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants